-
-
Notifications
You must be signed in to change notification settings - Fork 9
Global Scope
IsaacShelton edited this page Mar 21, 2022
·
1 revision
The global scope is an invisible scope that persists for the entire duration of the program
The primary case where the global scope plays a role, is where global variables need cleaning up before the program exits:
import basics
func main {
}
struct Bomb () {
func __defer__ {
print("Kaboom!")
}
}
bomb Bomb
Kaboom!