On 6/2/12 4:21 PM, Matthieu Monrocq wrote:
The problem with _ is that though it seems nice enough if there is one, but it is not as immediate for the reader to determine how many parameters the resulting function has. We could number them (_0, _1, _2) but it makes maintenance painful (if you remove _1, you have to remain all those which followed).
I guess each has its downsides. With named parameters, you can easily see how many there are at a glance but it's hard to see where they are used. With anonymous parameters, you can easily see where they are used but now how many there are. To be honest, I'd be satisfied with just having named parameters. But I thought I'd go for broke and get `_` expressions, which I happen to really like.
Also, this idea for `|| expr` as a closure was born as part of a larger syntax tweak for closures that pcwalton was tossing around the other day (though the anonymous parameters are my addition). In retrospect, I probably ought to have waited for him to write that up. I know he wants to focus on fixing bugs right now, which is absolutely right. Sorry Patrick. My bad. I just got annoyed at supporting bind and excited at the thought of underscores and there weren't many people around on IRC to discuss the idea with.
So anyway, let's table this idea for now. I think I'll perhaps just pursue removing bind (issue #2189) even without a specific replacement, confident that one will come along (if we decide we need one; perhaps `{|| ... }` is good enough).
Niko _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
