Skip to content

POD Variable

IsaacShelton edited this page Mar 21, 2022 · 1 revision

POD (variables)

Variables that are marked as POD (plain-old-data), are immune to __defer__ management procedures.

Usage Example

import basics

struct Bomb ()

func __defer__(this *Bomb) {
    printf("Boooooom!!!\n")
}

func main {
    test1()
    test2()
}

func test1 {
    bomb_dot_com Bomb
    
    print("Running test1...")
    
    // __defer__(Bomb) will be called
}

func test2 {
    bomb_dot_com POD Bomb
    
    print("Running test2...")
    
    // __defer__(Bomb) will NOT be called
}
Running test1...
Boooooom!!!
Running test2...
Clone this wiki locally