On 9/14/11 11:00 AM, Graydon Hoare wrote:
General responses:- The if/then/else form of if-exprs will not satisfy ternary users, I imagine, and requires a bunch of lookahead to find the 'then'; I don't particularly like the look of it. - Doesn't solve 'alt', does it? - Still requires the do { ... } block, no? - I believe a large measure of the purpose of expr-izing everything was to achieve greater compositionality in the grammar, i.e. for macro uses and whatnot. I think that's still a valid concern, so am hesitant to stmt-ize a grab-bag of exprs as suggested.
Fair enough; if others don't like separate expression and statement forms, I'd vote for |val| for block-expression, without the |res| (it's an interesting idea, but I'm not sure it's necessary -- maybe something to think about for future versions?) I suspect |val| will be rare.
- If we "ignore" trailing semis, don't we force people to write final-"nil" with some frequency, as in ML? I thought we had a pretty hard set of competing forces that pushed us into our current rules.
Only if we expect people to ignore return values a lot. I'd prefer that people didn't, but I guess this is orthogonal to the issue at hand.
Patrick _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
