Re: when to use "copy" vs "set" [was Re: Manipulating text]
Re: when to use "copy" vs "set" [was Re: Manipulating text]
- Subject: Re: when to use "copy" vs "set" [was Re: Manipulating text]
- From: "Mark J. Reed" <email@hidden>
- Date: Sat, 26 Sep 2009 18:50:44 -0400
On Sat, Sep 26, 2009 at 3:12 PM, has <email@hidden> wrote:
> If you're coming from a C background, I suggest you ignore the extra twist
> regarding the way that AS integers are represented internally, and just
> think of all AppleScript objects as heap-allocated structs.
Right. From the semantics, it may seem as though sometimes you're
assigning structs and sometimes you're assigning pointers to structs,
but logically they're all "pointers". The behavioral difference is
entirely down to the immutability: when you apply an operation to a
number or a string, it always creates a brand new number or string.
But there are some modifications you can apply to a list or record or
an application object that change the existing one in place instead.
So aliasing numbers or strings is harmless - they'll never change out
from under any of the pointers to them. But aliasing lists and
records and other objects is another matter.
--
Mark J. Reed <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