Re: the Holy Grail of AppleScript lists
Re: the Holy Grail of AppleScript lists
- Subject: Re: the Holy Grail of AppleScript lists
- From: Christopher Nebel <email@hidden>
- Date: Wed, 19 Mar 2003 13:16:14 -0800
On Wednesday, March 19, 2003, at 10:09 AM, Paul Skinner wrote:
Here's where I got a shock. I wanted to test the speed so I upped the
size of the list...
set delim to return
set l to {"3", "a", "C", "c", "B", 2, "A", 1}
repeat 10 times
set l to l & l
end repeat
set AppleScript's text item delimiters to delim
set t to text items of (do shell script ("echo '" & l as text) & "' |
tr '" & delim & "' '\n' | sort -f")
-->list of 8291 items.
!!! WHAT!? how many? how the... That can't... DAMN! wow.
Why this is possible I can't say. I'm hoping Nigel or Chris will
comment on the underlying reason.
Here's a hint:
set s to do shell script ("echo '" & l as text) & "' | tr '" & delim &
"' '\n' | sort -f")
text items of s --> (an 8192 item list)
class of s --> Unicode text
Here's another hint:
text items of (s as string) --> Error: Stack overflow.
"Unicode text" doesn't suffer from the stack-imposed limit that
"string" does. In another release, neither will "string".
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.