On 4/26/13 2:48 AM, Niko Matsakis wrote:
Patrick,
Nice work! I'm still digesting your full mail.
With respect to the pattern-names-as-type problem, I don't know if
restricting the pattern name to be an identifier is the right thing to
do. Would we be adding that restriction for all fn items, or just those
that appear in traits? There are default methods to consider.
Oh yes, you're right. This option is out then.
The other option is just to require parameter names on all method
declarations, which would be more consistent, but would also sometimes
be annoying for lightweight traits where the parameter names are
uninteresting.
I think we have to do this to avoid unbounded lookahead.
Finally, one could imagine requiring that patterns be parenthesized or
something like that? I confess that I sometimes find the current syntax
hard to parse, but I think that's at least partially because of the old
mode syntax (which is indeed ambiguous), parentheses might make it
clearer. But I think I wouldn't want them to be required in the `|...|`
closure syntax, so for consistency this option is probably out.
Yeah, I don't really like this idea, for the reason you gave.
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev