mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-21 21:24:59 -07:00
16 lines
218 B
Odin
16 lines
218 B
Odin
#import "fmt.odin"
|
|
|
|
main :: proc() {
|
|
maybe_print :: proc(x: ?int) {
|
|
if v, ok := maybe_value(x); ok {
|
|
fmt.println(v)
|
|
} else {
|
|
fmt.println("nowt")
|
|
}
|
|
}
|
|
|
|
maybe_print(123) // 123
|
|
maybe_print(nil) // nowt
|
|
}
|
|
|