Demaybe operator ?
This commit is contained in:
1 parent
f40482aa29
commit
c5d20d2eef
7 files changed
+107
-70
No files matched your search
+2
-1
@@ -1,8 +1,9 @@
|
||||
#import "fmt.odin"
|
||||
|
||||
|
||||
main :: proc() {
|
||||
maybe_print :: proc(x: ?int) {
|
||||
if v, ok := maybe_value(x); ok {
|
||||
if v, ok := x?; ok {
|
||||
fmt.println(v)
|
||||
} else {
|
||||
fmt.println("nowt")
|
||||
|
||||
Reference in new issue
Block a user