• 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: Deleting last item of a List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Deleting last item of a List
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Deleting last item of a List (From: Hanaan Rosenthal <email@hidden>)

  • Prev by Date: Re: Deleting last item of a List
  • Next by Date: Re: get "type" of disk i.e. CD, DVD, zip...
  • Previous by thread: Re: Deleting last item of a List
  • Next by thread: Re: Deleting last item of a List
  • Index(es):
    • Date
    • Thread