Exception handling vs. hasNext()

P T Withington ptw at pobox.com
Mon Nov 19 10:45:07 PST 2007

On 2007-11-19, at 12:40 EST, Brendan Eich wrote:

> This item iteration case has no more concise form analogous to for-
> each-in, because if ES4 were always to map:
> for (let [k, v] in map) ...
> to:
> for (let [k, v] in map.iterator::getItems()) ...
> it would wrongly preempt destructuring of arbitrary properties from
> the value returned by the default iterator

Say, if we don't waste parens on union types, what's wrong with:

for (let (k, v) in map) ...

?  Just a thought.

More information about the Es4-discuss mailing list