On May 18, 2011, at 10:30 AM, Marijn Haverbeke wrote: > (I have no strong opinion about types before names. But I do want to > point out that...) > >> I'm not sure how destructuring with TI affects this, so that could be >> exactly what I'm missing. Thanks for any info. > > Having name:type syntax would allow type annotations in destructuring > patterns. The current syntax makes that very hard to do. Same for > optional type annotations in inner functions, and destructuring in > function arguments. I *think* that this use of the ':' character is > compatible with our intention of using it for labels and record > fields. (ML, I expect, did think this through further than C did.)
Ok, this makes sense. Some foolish consistency when it comes to syntax can help (greater uniformity for people learning the language, learning inductively/constructively, developing intuition). ML seems less consistent in this light. : T as optional annotation after name seems more consistent. But consistency is overrated ;-). /be _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
