Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread James Boyden
On Tue, Sep 11, 2012 at 12:19 PM, Niko Matsakis n...@alum.mit.edu wrote: First off, I echo Brian's thank you for both the kind words and the well thought out e-mail. Here are some far less organized thoughts in response. Hi Niko, Thanks for your detailed response. (It's funny, both you and

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Niko Matsakis
On 9/11/12 12:54 AM, James Boyden wrote: I would also argue that such a single-'let'-out-front concession should not be applied to struct patterns: One of the key benefits of introducing 'let' in struct patterns is to disambiguate variable bindings from struct field names, which requires having

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread James Boyden
On Wed, Sep 12, 2012 at 12:14 AM, Niko Matsakis n...@alum.mit.edu wrote: On 9/11/12 12:54 AM, James Boyden wrote: I would also argue that such a single-'let'-out-front concession should not be applied to struct patterns: One of the key benefits of introducing 'let' in struct patterns is to

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Marijn Haverbeke
Are you saying that struct destructuring also occurs outside of match constructs, as a stand-alone assignment statement? Yes, he is, and that fact is one of the major constraints on what patterns may look like. The same pattern syntax is used in regular assignment and alt matching. Best,

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Nathan
Hello, I posted earlier about the confusion between enum discriminators and new bindings. James Boyden described the desire for consistency, which is a more general version of my concern. Here's another perspective: IDE support. I propose that the target IDE for a language should be find and

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Patrick Walton
On 9/11/12 11:11 AM, Nathan wrote: As a slight tangent: I'd like to see all of the rust compiler packaged into a clean modular interface which is highly available (perhaps even in std::rust for example), so that IDE / analysis tool authors have a leg up on writing parsers, code prettifiers,

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Patrick Walton
On 9/11/12 11:13 AM, Patrick Walton wrote: On 9/11/12 11:11 AM, Nathan wrote: As a slight tangent: I'd like to see all of the rust compiler packaged into a clean modular interface which is highly available (perhaps even in std::rust for example), so that IDE / analysis tool authors have a leg

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Benjamin Striegel
Ah, thank you for the clarification. I was not aware that such an operation could occur. (There are no examples of anything like it in the Tutorial or Reference Manual.) Be sure that you're looking at the up-to-date docs: http://dl.rust-lang.org/doc/tutorial.html#structs Rust struct types

Re: [rust-dev] Proposal/request to precede variable binding with let in destructuring pattern matching and closures

2012-09-11 Thread Graydon Hoare
On 12-09-10 2:27 PM, Patrick Walton wrote: Hi, This leads to this issue: let (let x, let y) = (1, 2); And it would be very difficult to parse something like this: (let x, let y) = (1, 2); Because the parser would have to do unbounded lookahead here to determine whether we're in a