[REBOL] Re: Links ? Pointers ?
From: izkata:g:mail at: 25-Aug-2009 2:09
He's talking about the possibility of multiple variables pointing at
an immutable value:
>> X: make object! [Name: {Spock}]
>> A: B: :X
Then, say, changing the object entirely:
>> X: make object! [Species: {Human}]
and having A and B now also point to the new object.
Here's a way to simulate it:
>> X: reduce [make object! [Name: {Spock}]]
>> A: B: X
>> X/1: make object! [Species: {Human}]
Now, A/1 and B/1 also point at the new object.
2009/8/25 Semseddin Moldibi [ Bircom ] <semseddinm-bircom.com>:
>>
>> Hello, I whish to ask a question to REBOL professional developers:
>>
>> If we have:
>>
>> A: [1 2 3]
>> B: C: :A
>>
>> B and C would share the same list of A
>>
>> If we set A
>>
>> A: ["something"]
>>
>> B and C would point to the list [1 2 3] and A to ["something"]
>
> This is because you created a new variable, not changed value(s) of A.
> If you use insert/replace/remove/clear and other series functions then
> A, B and C will point to the same variable.
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
=E5=A5=8F=E3=81=A7=E3=81=A6=E5=A4=A2