Array comprehensions shorter syntax (?)

Jose Antonio Perez joseanpg at gmail.com
Sun May 29 07:17:35 PDT 2011


2011/5/29 Dmitry A. Soshnikov <dmitry.soshnikov at gmail.com>

That's it, exactly. We always looking for a shorter sugar. Though, the main
> thing that the sugar shouldn't be cryptic at the same time. Probably
> Erlang's list comprehensions are cryptic for someone, but again, taking into
> account arrow-functions, seems arrow-comprehensions aren't so cryptic.
>

I think that your proposal based in Haskell's syntax is natural,clear and
easy for the user. A EBNF grammar for it:

ListComprehension :  '[' Expression '|'  IterableOrFilter
(,IterableOrFilter)+ ']'
IterableOrFilter:          Id '<-' ArrayOrGenerator | BooleanFilter

The problem is the LL(1) conflict with Array Literal, but that doesn't
matter much, right?  ;)

Jose.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110529/4fd600cb/attachment.html>


More information about the es-discuss mailing list