Re: coercing a list
Re: coercing a list
- Subject: Re: coercing a list
- From: has <email@hidden>
- Date: Sun, 2 Sep 2001 17:25:01 +0100
Scott Norton wrote:
>
TIDs are powerful, but always smell like software trickery to me. (Kind
>
of like
my favorite APL one-liners.) Usually, scripters use them when trying to avoid
using a Scripting Addition command like Akua Sweet's "decompose" command or one
of the regular expressions commands. As if using a third-party osax was the
sign of moral decay, like having machine-sewn fabric in your Civil War
re-enactor uniform, or serving vinigrette salad dressing at a wine tasting.
---
Well, I'm about as morally decayed as they come, so I've no qualms about
using OSAX at every opportunity. But this thread got me thinking after a
while, so I did some speed comparisons that seem to indicate that using
TIDs to break down a string into a one-dimensional list is significantly
faster than the jolly old "decompose x by y without sublists" I'm so used
to using. Even decomposing TAB/CR-delimited text (which means using a loop
to break down to sublists in the pure-AS method, so isn't as fast) seemed
at best to be a draw.
D-oh. I'll shortly be rewriting significant chunks of script as a result of
this. Right now, I need all the speed improvements I can get...
(grind-grind-grind)
Y'know though, it does kinda make me wonder if it wouldn't be best having
more of this really useful string/list manipulation stuff available within
AS itself. Then you'd only need a single, simple line of code to perform
and there'd be no calls to OSAXen slowing things down either.
Regular expressions would also be real nice. I think there's "Real
Scripters" out there who don't consider AS a worthwhile language because it
doesn't do reg ex (not out of the box anyway, which is where folks will
look first). (And first impressions always count.)
has