You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already have an available tag for errors in Value
The parsing and type checking would not be impacted
We could get rid of setjmp/longjmp
Throwing and returning becomes the same thing
try/catch would need to be removed
Introduce try to be explicit when we propagate errors. This new keyword is required because we will have to implement a new bytecode that returns if an error is raised.
var another = try couldFail(); | return the error if fails
var again = couldFail() catch defaultValue; | default if fails
New syntax to handle error based on its type to make up for the removed try/catch
var value = couldFail() catch {
Unexpected -> defaultValue,
else -> panic("you lost me")
}
Additionally for this to be really useful we would need Blocks #105 so we could write
var value = couldFail() catch {
Unexpected -> do {
| ... some complex things
break newValue;
},
else -> panic("you lost me")
}
The text was updated successfully, but these errors were encountered:
Value
setjmp
/longjmp
try/catch
would need to be removedtry
to be explicit when we propagate errors. This new keyword is required because we will have to implement a new bytecode that returns if an error is raised.try/catch
The text was updated successfully, but these errors were encountered: