Minimalist (why) classes ?
John J Barton
johnjbarton at johnjbarton.com
Mon Nov 14 11:15:49 PST 2011
On Mon, Nov 14, 2011 at 10:42 AM, Rick Waldron <waldron.rick at gmail.com> wrote:
>
>
> On Mon, Nov 14, 2011 at 11:48 AM, John J Barton
> <johnjbarton at johnjbarton.com> wrote:
>>
>> [snip]
>>
>> Sorry I don't understand. Every function which accepts object
>> references and embeds its arguments in [[Prototype]] (either in the
>> return value or the instance created from the return value) faces the
>> copy-ish problem.
>
> This is a negligent conflation.
Ouch, that sounds really bad! Except I don't understand what you mean ;-)
> Pass by reference is not the same as
> ensuring that when extending one object with another, the resulting object
> is not implicitly capable of mutating its source objects (as is the case in
> Selfish).
I don't understand this sentence. I guess you mean: "The issues of
extend() is not related to pass by reference vs pass by value." If
so, I disagree.
If extend() only allows object literals as arguments then you don't
have to copy, deep or shallow. That's how syntax like Allen's <|
avoids the copy problem.
But extend() can't limit its arguments to object literals. So it must
deal with copy. Am I wrong?
jjb
More information about the es-discuss
mailing list