-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
bytecodeIssues related to bytecodeIssues related to bytecodecompilerIssues related to compilation & parsingIssues related to compilation & parsingenhancementNew feature or requestNew feature or request
Milestone
Description
Syntax
maybe_an_int: int? = some_function_call()maybe_give_int = fn() -> int? {
if math.rand() * 2 == 1 {
return 42
}
return nil
}# Initialize later
coolest_person: str? = nil
# Do some work...
print coolest_person # Some(Person { name: "Mateo", age: 16 })?= and get
Will resolve as true if the variable exists, and False if it does not exist.
maybe_best_fruit: str? = read_fruit_db()
if best_fruit ?= maybe_best_fruit {
print best_fruit
} else {
print "maybe_best_fruit is empty"
}
best_fruit = get maybe_best_fruit : "Guava"
// has the potential to abort if maybe_best_fruit is nil
best_fruit_dangerous = get maybe_best_fruit
print best_fruit
print maybe_best_fruit
none_str: str? = nilReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bytecodeIssues related to bytecodeIssues related to bytecodecompilerIssues related to compilation & parsingIssues related to compilation & parsingenhancementNew feature or requestNew feature or request