> I don't remember the reason exactly. I thought there was a syntactic
> collision somewhere down in the pattern syntax. But I can't recall exactly
> what it is.
The pattern thing was a red herring (it was part of the proposal that
didn't really hold together). As I understood things, we wanted to
remove tuples for minimalism reasons (less data types, less syntax,
etc).
I still think this was a good decision. With the exception of the
zip/unzip functions, all the code I touched when removing tuples got
more readable in the process. Pure, abstract pairs / triples of things
are rare. Usually, the fields have clear roles, and it is beneficial
to name them. 'val._0' does not tell you what you're getting, and I
found myself constantly looking up the order of the fields in tuples,
even those returned by functions I wrote myself.
As for destructuring, records seem to work very well there. In most
cases, you'll use the field names for your variables, so you get
simply
let {key, val} = someexpression();
When they clash, you get a slightly more verbose '{key: keyname}'
syntax, but nothing that makes me want to revive tuples.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev