3 ms·
From a quick scroll, that seems to be just C-style `select` with `if` guards? What I was referring to is things like `match x { Some(y) => ..., None => ... }`,
by ralfj 4y ago
From a quick scroll, that seems to be just C-style `select` with `if` guards?
What I was referring to is things like `match x { Some(y) => ..., None => ... }`, where there is data that is available only in some variants of the type (like `y`). Without a type, even naming these variants becomes an interesting problem. (Not unsolvable, mind you. But not obvious either, and you lose some of the benefits that algebraic data types have in typed languages.)
- int_19h 4y agoNo, it matches on the structure of data as well as embedded values. E.g. you can match on %{foo: y} vs %{bar: y}.