Re: Adding To A List
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