• 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: Adding To A List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding To A List


  • Subject: Re: Adding To A List
  • From: has <email@hidden>
  • Date: Thu, 2 Jun 2005 13:39:04 +0100

kai wrote:

>>set the end of the newList to (items of currentList) -- shallow-copy the list
>>
>>copy currentList to the end of the newList -- deep-copy the list
>
>Now there's an interesting thing. A few brief tests here indicate that, while 'copy x to y' is faster with shorter lists, 'set y to items of x' seems to handle longer ones more efficiently...

Speed is really irrelevant: the difference is insignificant when measured as a percentage of overall program performance. You should use whichever method is appropriate for the task. Some situations _require_ shallow copying, some _require_ deep copying. Others it doesn't matter which you use: it's only an issue when duplicating a list containing mutable values (lists, dates, records, script objects), and even then it depends on what you're doing with those lists whether it's important or not.

Cheers,

has
--
http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
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: Adding To A List
      • From: kai <email@hidden>
  • Prev by Date: RE: EPS to JPEG
  • Next by Date: QXPScriptingAdditions
  • Previous by thread: Re: Adding To A List
  • Next by thread: Re: Adding To A List
  • Index(es):
    • Date
    • Thread