Add a try reserved word #109

Open
opened 2024-11-25 17:29:56 +00:00 by scott · 0 comments
Owner

try is like the propagation/? operator in Rust:

Given a result tuple, it either evaluates to the (:ok, value) in a success, or returns early with an (:err, msg) tuple.

Easy enough! (And it does this not at the function level but at the block level.)

One question is what it should do if it doesn't get a tuple. Two options: panic! or return that value.

`try` is like the propagation/`?` operator in Rust: Given a result tuple, it either evaluates to the `(:ok, value)` in a success, or returns early with an `(:err, msg)` tuple. Easy enough! (And it does this not at the function level but at the _block_ level.) One question is what it should do if it doesn't get a tuple. Two options: `panic!` or return that value.
scott added the
enhancement
next
labels 2024-11-25 17:29:56 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: twc/ludus#109
No description provided.