• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: set vs copy?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: set vs copy?
      • From: Shane Stanley <email@hidden>
References: 
 >Re: set vs copy? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: set vs copy?
  • Next by Date: Re: set vs copy?
  • Previous by thread: Re: set vs copy?
  • Next by thread: Re: set vs copy?
  • Index(es):
    • Date
    • Thread