Day 2 meeting notes
Oliver Hunt
oliver at apple.com
Thu Jul 29 16:55:59 PDT 2010
On Jul 29, 2010, at 2:47 PM, Waldemar Horwat wrote:
> Comprehensions: To be useful, need to have a bunch of basic helpers
> such as range(), properties(), values(), etc. with short names that
> can be used to construct comprehensions. These will be added to the
> proposal.
>
> Would like to be able to interleave for and if clauses:
> [x*y for (x in range(...)) if (isprime(x)) for (y in range(x+1...)) if
> (isprime(y))]
I keep seeing code like this, I simply don't see it as viable to have "for (.. in ...)" sometimes enumerate property names, and some times enumerate keys, it seems like it could be both confusing and error prone. esp. given the simplest example: [x for (value in [1,2,3])] you would not get the desired behaviour, unless in comprehensions for(in) behaves differently from everywhere else.
It seems far better to just define a distinct syntax for enumerating values of an object.
--Oliver
More information about the es-discuss
mailing list