> And (sorry, I'll try to keep replies in one message next time) "for" vs. 
> "forvals" does not exactly scream "keys" vs. "values", since "for" is only 
> about "keys" if you know ECMA-262 and expect the mystery meat of enumeration.

IMO, "forvals" is a non-starter, as is "foreach" or "for each". The "for" part 
of the syntax denotes quantification, and the stuff to the right of the 
variable denotes what is being iterated. In all cases, we are talking about 
universal quantification, so they should all be "for".

> Which raises another point: meta-programmable iteration is not necessarily 
> about "values" and not "keys". A custom iterator could (and in the strawman 
> does) return key/value pairs. The whole keys vs. values dilemma is a false 
> one here.

Indeed. There are an unbounded number of types of sequences that can be 
iterated over. Whether we provide 2 or 200 it will never be enough. Hence the 
need for a general, programmable iteration mechanism.

Dave

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to