On Nov 17, 2011, at 1:30 PM, Brendan Eich wrote:

> If I have code of the kind Mike Samuel showed:
> 
> obj
> with ({ foo: 12 })
> {}
> 
> and I migrate directly into ES-whatever with 'with' as you propose (instead 
> of <|), then I do not get an early error.

Understood.

>>> Also, using 'with' around object literals makes me want functional record 
>>> update. IIRC we've talked about that before.
>> 
>> That's one of the things I like about `with` for this: prototype extension 
>> is already a great mechanism for functional update on objects.
> 
> Prototype extension or delegation is not the same as FRU at all -- the 
> delegating object can shadow proto-properties,

That's precisely what makes it analogous to FRU. You functionally update (i.e., 
update without mutating) by shadowing.

> the chaining is observable many ways (methods on the prototype, not only 
> reflection APIs), there are two objects not one.

Yes it's observable, but it's a very natural fit. It's how I do FRU today, 
using Object.create.

Dave

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to