> The other option is just to require parameter names on all method declarations
I honestly wasn't even aware that it was possible to omit the parameter names when declaring traits (it's not mentioned in the tutorial or in any code I've ever seen). It makes sense in retrospect, but I wouldn't really miss it. On Fri, Apr 26, 2013 at 12:01 PM, Patrick Walton <pwal...@mozilla.com>wrote: > 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 > Rust-dev@mozilla.org > https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev> >
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev