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