I believe eliminating tuples was a mistake. Just look at what happens to the 
zip function:

    fn zip<T,U>(&[T] a1, &[U] a2) -> [{ fst: T, snd: U }]

or with a typedef for pairs:

    fn zip<T,U>(&[T] a1, &[U] a2) -> [Pair<T, U>]

Another use case: debugging with polymorphic log:

    log (x, y, z);

is way more convenient than:

    log #fmt(...);

Tuples are simple and lightweight. I haven't heard any arguments for what harm 
they cause. The compiler complexity is not far-reaching, it's just a few more 
cases in the structural recursions over Rust types.

The argument against has mostly been "they don't provide much value and you 
*should* use records instead." I disagree. There are plenty of cases when 
programming in-the-small where tuples are cleaner and simpler than records, and 
those little cases add up.

Dave

On Aug 5, 2011, at 12:13 PM, Patrick Walton wrote:

> The lack of them makes destructuring assignment a lot less convenient...
> 
> Patrick
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to