Maybe ban holes, then...
Brendan Eich
brendan at mozilla.org
Thu Feb 2 13:10:41 PST 2012
Ok, you guys have holes in your head. No offense!
Holey patterns are useful, as occasionally are holey arrays. If you
disagree on the latter, please acknowledge we are stuck with holey
arrays for a long time, and array destructuring patterns are
supplemental syntax based on a cover-grammar parse as array literals.
This says holes win. If we have to argue about this, I think we'll do a
disservice to bigger-impact issues that need resolution.
/be
> Herby Vojčík <mailto:herby at mailbox.sk>
> February 2, 2012 12:21 PM
>
>
> A bit off-topic... I don't like paretheses. Not only because I have to
> put them in both ends, but also because of uncomfortable feeling of
> "thing closed in parentheses".
>
> Maybe alternative convention to deal with expressions beginning with {
> could be used as well:
>
> 0, {5:x} = someArray;
> 0, {0:a, 2:y} = someArray;
>
> Herby
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
> Herby Vojčík <mailto:herby at mailbox.sk>
> February 2, 2012 11:49 AM
>
>
>
>
> If
>
> {"5":x} = someArray;
>
> and
>
> {"0":a, "2":y} = someArray;
>
> would be possible, there is probably little need for holes. In case of
>
> [a,b,c,d,,f] = someArray;
>
> one could always use (some conventional) anon-var, like _ (from Prolog):
>
> [a,b,c,d,_,f] = someArray;
>
> Herby
>
More information about the es-discuss
mailing list