Follow

I really like Rust's use of the `match` block. This feels like what switches want to be, but in a way that's more useable. I like that you can assign a variable to be the value of a match block, and I also like that a function returning a Result can return either an Ok() or an Error().

I like the idea of functions having to implement returns for *ok* and *error*, e.g.:

```
name = match getCustomerName(some_id) {
ok: { |v| v.first_name + v.last_name },
error: { |e| yield_error () }
}
```

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!