with

David Herman dherman at mozilla.com
Thu Nov 17 06:15:31 PST 2011


On Nov 17, 2011, at 5:37 AM, Axel Rauschmayer wrote:

> [cc-ing es-discuss again]
> 
> On Nov 17, 2011, at 14:20 , Russell Leggett wrote:
> 
>> If <| changed to allow non-literal RHS values, I could see it getting more use
>> 
>>     obj <| comparable <| enumerable <| {...}
>> 
>> but right now, that has a big hurdle and I've yet to see anybody but me propose a solution.

Allen's semantics for <| depends on the RHS being a literal, because it infers the [[Class]] and such from the literal, and because it takes any private names from the object literal form.

> True, that’s the catch. Then it works for composing an inheritance hierarchy (as in mixins as abstract subclasses).
> 
> Another idea for `extends` (if there is more than one object that is being extended):
> 
>      extends(comparable, enumerable, foo, bar) { ... }

I'm not sure what the semantics of this would be. Are you inventing multiple-prototype inheritance? That's not going to happen.

Dave



More information about the es-discuss mailing list