Fix comments

This commit is contained in:
gingerBill
2021-07-05 16:26:11 +01:00
parent a98eee145d
commit 3b9ca8535f
+3 -3
View File
@@ -2003,7 +2003,7 @@ or_else_procedure :: proc() {
fmt.println("\n#'or_else'"); fmt.println("\n#'or_else'");
// IMPORTANT NOTE: 'or_else' is experimental features and subject to change/removal // IMPORTANT NOTE: 'or_else' is experimental features and subject to change/removal
{ {
// 'try else' does a similar value check as 'try' but instead of doing an // 'or_else' does a similar value check as 'try' but instead of doing an
// early return, it will give a default value to be used instead // early return, it will give a default value to be used instead
m: map[string]int; m: map[string]int;
@@ -2013,13 +2013,13 @@ or_else_procedure :: proc() {
if i, ok = m["hellope"]; !ok { if i, ok = m["hellope"]; !ok {
i = 123; i = 123;
} }
// The above can be mapped to 'try else' // The above can be mapped to 'or_else'
i = or_else(m["hellope"], 123); i = or_else(m["hellope"], 123);
assert(i == 123); assert(i == 123);
} }
{ {
// 'try else' can be used with type assertions too, as they // 'or_else' can be used with type assertions too, as they
// have optional ok semantics // have optional ok semantics
v: union{int, f64}; v: union{int, f64};
i: int; i: int;