Re: TIDs case insensitive?
Re: TIDs case insensitive?
- Subject: Re: TIDs case insensitive?
- From: "Arthur J Knapp" <email@hidden>
- Date: Sat, 10 Mar 2001 12:02:06 -0500
>
Subject: Re: TIDs case insensitive?
>
Date: Fri, 9 Mar 2001 11:29:21 +0000
>
From: Nigel Garvey <email@hidden>
>
like to see the TID's made less of a production number and less permanent
>
in scope. For instance, they could be used as individual command
>
parameters (as with the 'read' command) instead of being long-windedly
>
set until reset. This would also (in theory) lessen the effort of
>
resetting them should anything go wrong while they're at non-default
>
values.
>
>
set fred to text items of pathString using delimiters {":"}
This is interesting.
It would turn the syntax "text items of" into more of a command
than a property/reference, which might have it's own drawbacks,
but the concept is very sound.
Along the same lines, how about something like:
"A" is "a" considering case -- > false
>
And/or perhaps they could have their own scope blocks:
>
>
using delimiters{":"}
>
set fred to text items of pathString
>
... blah blah blah ...
>
end using
This is also a very keen idea.
With regards to considering/ignoring statements, I would
like to see the "parameters" changed to evaluated constants, ie:
set variable01 to case
set variable02 to hyphens
considering variable01, variable02
-- stuff
end
or even to a variable-length list of constants:
set considerList to { case, diacriticals, expansion }
set ignoreList to { hyphens, punctuation, white space }
considering considerList but ignoring ignoreList
...
It is very frustrating when creating a general purpose handler
that two separate code blocks must be created to allow for
different comparison systems/algorithms.
While there are many problems with the fact that the tids
are "global" in scope, there is a similar problem with the
fact that a considering/ignoring statement will extend into
it's enclosed handler calls:
ignoring white space
-- stuff
my compareFunction(a, b) -- white space will be ignored
-- stuff
end ignoring
This makes it very difficult for someone who is attempting
to make distributable script libraries to protect against.
Nigel's notion of limiting scope sounds like a good idea,
both for the tids and for considering/ignoring.
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://home.earthlink.net/~eagrant/