Skip to content

Intrinsic Procedure __defer__

IsaacShelton edited this page Mar 21, 2022 · 2 revisions

'__defer__' function

The __defer__ function can be used to run code after a value runs out of scope.

import basics

struct Bomb ()

func __defer__(this *Bomb) {
    print("kapow!")
}

func main {
    my_homemade_bomb Bomb
}
kapow!
Clone this wiki locally