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

Axel Rauschmayer axel at
Tue Nov 8 15:24:04 PST 2011

>> I see two domains for the concept of “own” properties:
>> 1. Meta-programming.
>> 2. Using objects as dictionaries.
> Thanks, good to focus on use-cases. Both would like shorthand and freedom from Object.prototype.hasOwnProperty tamper-proofing.
>> Isn’t #2 the majority (at least as far as non-library-programmers are concerned)? Will the concept become less relevant once we have David Herman’s dicts?
> We don't know how dicts will fare. Making progress with for own does not interact badly with dicts if we spec them to be for-in'able -- for own (k in d) for d a dict should work, just as for objects.

Ah, shame. I had hoped that a good dictionary implementation would largely make the notion of own properties obsolete (except for #1 use cases). Bringing inheritance into the collection mix seems problematic. That’s why I like Allen’s “data-only-[]” proposal.

I agree with “not interact badly” if there are indeed other use cases.

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list