MACSCRPT Archives

May 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Deivy Petrescu <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 20 May 2009 16:14:41 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
On 20/05/2009, at 13:47 , Stockly, Ed wrote:

>> Concatenation is the wrong way to build up a list anyway, if you're  
>> adding an
> item at a time.  The "set end of" approach is always the way to go,  
> whether it's
> records or something else.
>
> Agree....
>
>>   List concatenation is more for combining two lists that might  
>> already have
> multiple items each.
>
> Yes, but if you're dealing with records and combining lists and  
> records this
> is bound to be problematic.
>
> ES

No, Ed, it is not!
Here:

set recordList to {}
set oneRecord to {foo:1, bar:"hello"}
set end of recordList to oneRecord
set twoRecord to {foo:2, bar:"Goodbye"}
set end of recordList to twoRecord
recordList
--->{{foo:1, bar:"hello"}, {foo:2, bar:"Goodbye"}}

ATOM RSS1 RSS2