Structs

Mike Shaver mike.shaver at gmail.com
Wed Jun 2 06:47:27 PDT 2010


On Wed, Jun 2, 2010 at 7:02 AM, Sam Ruby <rubys at intertwingly.net> wrote:
> On 06/02/2010 03:52 AM, Jason Orendorff wrote:
>>
>>> I'll still maintain that the choice that ECMA 334 takes, namely
>>> that the assignment to b in the example above, makes a mutable
>>> copy is a valid choice.
>>
>> I would expect
>>   a[0].x = 3;
>> to modify a[0], not a temporary copy of a[0]. How do you propose to
>> make that work in ES?
>
> I'll note that that is not the way strings work today:
>
> a = "abc';
> a[0] = 'x';

Strings are immutable, so I'm not sure they're a good guide here.

Mike


More information about the es-discuss mailing list