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

Brendan Eich brendan at mozilla.com
Tue Nov 8 14:39:29 PST 2011


On Nov 8, 2011, at 1:48 PM, Claus Reinke wrote:

>> for own (i in o) {
>>   body
>> }
> 
> What happened to @iter.keys and 'for (key of keys) {}'?

Still there, but write it out fully, to compare to the cited text:

  import keys from "@iter";
  for (i of keys(o)) {
    body
  }

Unless we default-import a standard prelude, this is a bit much compared to add own as a modifier after for in for/in (not for/of) loops.

/be

> 
> http://wiki.ecmascript.org/doku.php?id=harmony:iterators
> 
> Claus
> http://clausreinke.github.com/
> http://clausreinke.github.com/js-tools/ 

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


More information about the es-discuss mailing list