Demaybe operator ?

This commit is contained in:
Ginger Bill
2016-10-07 09:41:38 +01:00
parent f40482aa29
commit c5d20d2eef
7 changed files with 107 additions and 70 deletions

View File

@@ -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")