Re: set vs copy?
Re: set vs copy?
- Subject: Re: set vs copy?
- From: Thomas Fischer <email@hidden>
- Date: Wed, 15 Sep 2010 09:40:41 +0200
Hi,
my point was:
if you
set end of A to 4
B is changed, but if you
set A to {6, 7, 8}
B remains unchanged and keeps the old value of A.
That was what puzzled me.
There seems to be a difference between modifying A and giving A a new value, which is not obvious from the "set" command.
In particular, there is a difference between
set A to A & 4
and
set end of A to 4
with respect to the value of B.
Cheers
Thomas
Am 15.09.2010 um 09:06 schrieb Shane Stanley:
> On 15/9/10 4:51 PM, "Thomas Fischer" <email@hidden> wrote:
>
>> set A to {1, 2, 3}
>
> So A points to a bit of memory that holds the list {1, 2, 3}
>
>> set B to A
>
> B points to the same bit of memory as A
>
>> copy A to C
>
> What A points to is duplicated, and C points to this new list
>
>> set A to {6, 7, 8}
>
> A now points to a new bit of memory holding {6, 7, 8}. This doesn't affect
> what A or C are pointing at.
>
>
> --
> Shane Stanley <email@hidden>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden