Re: the Holy Grail of AppleScript lists
Re: the Holy Grail of AppleScript lists
- Subject: Re: the Holy Grail of AppleScript lists
- From: has <email@hidden>
- Date: Wed, 19 Mar 2003 22:38:18 +0000
Paul Skinner wrote:
-->list of 8291 items.
Nothing very remarkable in this. Despite what the Standard Additions
dictionary might claim, the 'do shell script' command returns Unicode
text, not a string. The ~4000-item stack overflow problem only
affects the latter type.
Other stuff:
- Re. using the shell to sort: while quicker at sorting strings than
a native sort routine, it'll never make a good general-purpose list
sort for AppleScript, given that what comes out isn't necessarily
what went in. The shell's own sort command's usefulness in sorting
text is also limited, given that it reserves the line feed character
for its own nefarious purposes and only understands characters in the
ASCII 0-127 range anyway. If you attempt to sort text containing any
other characters, you'll get bad results - Perl or Python might be a
better bet.
- Remember to use 'quoted form of theString' when including it in the
shell script. (Every 'do shell script' user should get this reminder
tattooed on their hands where they won't keep forgetting it.)
- I fail to see your problem with using Serge's quicksort library
just because the code behind it is large and complicated. (I can
assure you that the code behind the sort commands in the shell,
Python, Perl, etc. is a heck of a lot larger and more complicated
than this.) It's not like you have to look at any of it - never mind
understand it all - in order to use it. Its interface may not be
perfect, but it's well documented and easy enough to use, and it
takes just one more line of code to bind it to your script:
property SortLib : load script (alias "path to quicksort library")
...
set sortedList to SortLib's quicksort(myList)
(Perl and Python users, for example, have absolutely no problem with
libraries, so - lack of a convenient 'import' command for the
terminally lazy notwithstanding - I'm not sure why so many AS users
should have such a hangup over the things. Go figure.)
has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.