On Mon, Nov 22, 2010 at 8:37 AM, David Herman <dher...@mozilla.com> wrote:

> > for (var i : x) ...      // must be new iteration
> > for (var i : T : x) ...  // iteration again, but parsed how?
> > for (var i : T in x) ... // for-in with annotated var
>
> Bummer!
>
> I'm beginning to feel more strongly again that overloading for-in, as
> opposed to introducing yet another syntactic variant of `for', is the right
> way to go.
>
> <thought experiment>
> Imagine we made Harmony backwards-incompatible in the following way: for-in
> loops would *only* work on iterable objects, and would dynamically fail on
> non-iterable objects. So if you wanted the legacy keys behavior, you would
> have to explicitly call a `keys' library function.
> </thought experiment>
>
>
If we're gonna go invent new keywords why not use the obvious?

iterate (var x in y) ...
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to