On May 18, 2011, at 10:11 AM, Marijn Haverbeke wrote:

>> Depends on the exact syntax you want, I suppose, but this could be
>> done with at most single token lookahead right? Simplest option (no
>> lookahead needed):
> 
> We'll probably keep the type, which can be arbitrarily complex, in
> front of the variable name. We also plan, at least in the
> type-deducing variant, to allow destructuring, making the two even
> more dissimilar.


I like type in front from C and C++, but it has caused huge mischief in the 
lexers and parsers for those languages. Is it worth it?

People in this thread mentioned {x: uint, y: uint} vs. {uint x, uint y}, and it 
does seem worth getting types-in-front in all contexts.

But the type-after-colon approach is strictly simpler to parse and make 
optional. Can someone say why types-in-front wins? It's ok if it is an 
aesthetic judgment by BDFL or cohort, I am mainly asking if I'm missing a 
deeper reason.

I'm not sure how destructuring with TI affects this, so that could be exactly 
what I'm missing. Thanks for any info.

/be

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to