0. yes to (for|if)* - also for generator expressions

1. Array comprehensions with for/if do not look very readable - the generators and filters seem to merge into one blob of text.
[x*y for x of range(XDIM) if x&1 for y of range(YDIM)]

   While syntax highlighting and/or formatting can help
   to make the individual items stand out:

   [x*y for x of range(XDIM)
           if x&1
           for y of range(YDIM)]

   There may be syntactic alternatives that make it easier to
   spot and separate the generators and filters. ES syntax
   tweaking is notoriously tricky, but perhaps something like

[ x*y : x of range(XDIM); x&1; y of range(YDIM) ]
Claus

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to