I wonder how Nim 3/Nimony handles or will handle bindings in patterns regarding copy, move or reference. Rust can change it per binding, and Ada's experimental pattern matching might have some plans or properties regarding that.[1]
> By default, identifier patterns bind a variable to a copy of or move from the matched value depending on whether the matched value implements Copy.
> This can be changed to bind to a reference by using the ref keyword, or to a mutable reference using ref mut. For example:
match a {
None => (),
Some(value) => (),
}
match a {
None => (),
Some(ref value) => (),
}
.The Github issue had a strange discussion. I really disliked goteguru's equals-sign-based syntax, though I had difficulty judging the main design syntax.
I wonder what Araq thinks of Scala's Expression AST type. Tree, TermTree, and all the subtype case classes [2]. Tree has fields. Though I am not certain how the common variables are initialized.
[1] https://doc.rust-lang.org/reference/patterns.html#r-patterns...
[2] https://github.com/scala/scala3/blob/main/compiler/src/dotty...