Skip to content

Intrinsic Procedure __defer__

IsaacShelton edited this page Nov 16, 2022 · 2 revisions

'__defer__' method

The __defer__ method 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