Re: Deleting last item of a List
Re: Deleting last item of a List
- Subject: Re: Deleting last item of a List
- From: "Shane Stanley" <email@hidden>
- Date: Sat, 20 Nov 2004 15:37:55 +1100
On Fri, 19 Nov 2004 20:59:16 -0500, Hanaan Rosenthal wrote:
>So do the lists differ, as I said, in the way the are handled in
>memory, or not?
Not in the way you suggested. The difference is that one version creates
a new list, while the other merely modifies an existing list -- the
efficiency comes from this fact, not anything to do with being spread out
in memory. To quote from some (now ancient) release notes:
"Unlike concatenation, setting the beginning or end of a list actually
changes the list. [...] In these cases, we can greatly increase the
efficiency of our scripts by inserting items rather than concatenating
them, forming new lists and leaving the old ones as garbage.[...] For the
record, setting the end of a list is by far the most efficient, and
setting the beginning is second (because all the items must be slid down
to make room for a new first item)."
That's from more than 10 years ago, but I seem to recall Chris Nebel
confirmed here more recently that it is still the case.
--
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:
This email sent to email@hidden