Re: COPY TO a list vs. SET TO a list
Re: COPY TO a list vs. SET TO a list
- Subject: Re: COPY TO a list vs. SET TO a list
- From: JJ <email@hidden>
- Date: Tue, 18 Dec 2001 19:28:22 +0100
>
--
>
set theList to {,
>
{"Olivier", 2, 3, 5, 108}, ,
>
{"Martin", 17, 19, 20, 21}, ,
>
{"Frank", 4, 8, 48}}
>
>
set item 2 of theList to item 2 of theList & 6
>
copy 57 to end of item 3 of theList
>
>
--
>
>
What's the better way and why ?
I don't know what's the better, but I'd use COPY method, because (at this
concrete example) seems that "set" way:
__________
Are two operations:
set New_Value to Concatenate_Item_To_List_of_Items
set Some_Reference to New_Value
__________
And, the second one, only one operation:
set Some_Reference to New_Value
_____________
So, the second one is quickly.
Make sense that:
set x to 1
set y to 2
is quicker than:
set {x,y} to {1,2}
So, less code is not more speed nor optimization.
(but seems that "copy" is less code and better speed performance)
JJ