On Wed, Sep 12, 2012 at 1:10 AM, Marijn Haverbeke <[email protected]> wrote:
>> 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.
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.)
I wouldn't be particularly keen on a 'let'-laden syntax like:
let Foo { x: let x, y: let y } = ...;
The obvious alternative is a version without an initial 'let':
Foo { x: let x, y: let y } = ...;
But would this be parseable?
And even if it _were_ parseable, it's still closer to the "subtle" end
of the statement spectrum than I'd like -- you don't really know what
you're looking at until you reach the 4th whitespace-delimited token.
I'll have to think about this further.
Thanks,
jb
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev