Refutable destructuring

Dmitry Soshnikov dmitry.soshnikov at
Fri Aug 16 12:43:29 PDT 2013

On Fri, Aug 16, 2013 at 12:38 PM, Kevin Smith <zenparsing at> wrote:

> Do you not think that it would be awkward to have the exact same pattern
>>> syntax for these two cases (matching and destructuring), but with different
>>> semantics?
>> Yes, I don't think so.
> Hmmm... Let me rephrase.  It would be awkward and confusing to have
> divergent semantics for the same pattern syntax in destructuring and
> matching.
This is again if we need strict matching. As long as JS is assignment-base
language with mutable state and that foo.nonExisting === undefined today, I
think the destructuring w/o throwing should be the main course. And if you
want the strict match, it can be an extension. If we need it. If we have
use-cases. This match(...) is just an idea, of course it should be worked

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list