for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

Brendan Eich brendan at mozilla.com
Tue Nov 8 14:37:32 PST 2011


On Nov 8, 2011, at 1:19 PM, Jeremy Ashkenas wrote:

> On Tue, Nov 8, 2011 at 3:49 PM, Brendan Eich <brendan at mozilla.com> wrote:
> 
>   for own (i in o) {
>     body
>   }
> 
> This is a small thing but it might pay off in the long run.
> 
> This is a very useful feature ... but for better or for worse, also shows off how much paren-free would help things. "for own key in object {" reads well, whereas "for own (key in object) {" reads strangely, because the adjective "own" naturally belongs next to it's nown "key", without an interloping lparen.

You'll be glad to know I'm still working on paren-free. You will be unsurprised to hear it needs even more newline significance to overcome some issues Waldemar Horwat pointed out.

I give paren-free very long odds for ES.next. Better to design and prototype it, get it in as an opt-in for Narcissus, SpiderMonkey and other implementations to enable user-testing.

Good news for ES.next remains: array comprehensions and generator expressions use *only* paren-free for/of syntax.

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111108/ca6f45d7/attachment.html>


More information about the es-discuss mailing list