Re: List Question: Can someone explain this to me?
Re: List Question: Can someone explain this to me?
- Subject: Re: List Question: Can someone explain this to me?
- From: Nigel Garvey <email@hidden>
- Date: Fri, 14 Jun 2002 12:27:20 +0100
Jon Pugh wrote on Thu, 13 Jun 2002 19:20:34 -0700:
>
At 1:27 AM +0100 6/14/02, has wrote:
>
>BTW, while I'm not entirely sure, I do have a strong feeling the ASLG
>
>explanation is really half-truth, half-fib. AFAIK, data is never copied in
>
>AS unless explicitly instructed, thus 'set n to m' will mean a single
>
>object is shared between both n and m regardless of its type.
>
>
I don't believe so. One of the more amusing parts of AppleScript
>
development was having Warren come to the weekly meeting and complain about
>
the similarity and differences between "set" and "copy". He battled with
>
it right up to the time AppleScript shipped.
>
>
Now, a lot has happened since then, but not that much, I'll bet.
One has to give you credit, Jon, for having been in on things from the
beginning, but do you "not believe" here, or do you "know"? My own bet
about 'copy' and 'set' has always been the one described by has.
It makes sense (and sounds easier to implement) if 'copy' *always*
duplicates data and creates new pointers, while 'set' only duplicates
pointers to existing data. It *doesn't* make sense for 'copy' to behave
like 'set' with simple data but then do something quite different with
compound data. (It's also not born out by the fact that 'copy' always
takes slightly longer to execute than 'set', regardless of the data
type.) It's an unnecessary complication when, as has pointed out, data
sharing simply isn't an issue with simple items.
I expect the real truth lies somewhere in between. Hard (simple) data are
probably not duplicated by either command, even when they're in lists or
records. It'll be the intervening pointer structures (including the lists
and records themselves) that are either duplicated or not.
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.