Case sensitivity/insensitivity
David Goodger
dgoodger at bigfoot.com
Mon May 22 12:40:56 EDT 2000
on 2000-05-22 12:12, Bjorn Pettersen (bjorn at roguewave.com) wrote:
> "John W. Baxter" wrote:
>> In article <39271A25.A348E4B9 at roguewave.com>, Bjorn Pettersen
>> <bjorn at roguewave.com> wrote:
>>
>>> This brings up another interesting point... I'm assuming the subjects
>>> from the Alice project/research would also prefer:
>>>
>>> 'token' == 'Token'
>>
>> AppleScript (not to be taken as "the only right way") does that:
>>
>> "token" is "Token"
>> returns true, while
>>
>> considering case
>> "token" is "Token"
>> end considering
>> returns false.
>
> But all those English keywords must be very confusing to people who do
> not speak the language... I suggest we implement a global dictionary
> that maps the language specific keyword names (or phrases, not all words
> have a one-to-one mapping) to their canonical form... Just think, I
> could spell the common pydiom (I'm assuming this was perfectly clear to
> the Alice people ;-):
>
> while 1:
> line = f.readline()
> if not line:
> break
> ...
>
> as (with the Norwegian mapping...):
>
> så lenge som 1:
> linje = f.lesLinje()
> hvis ikke linje:
> brekk
> ...
That's another thing that AppleScript does (or did; I'm not sure if it's
still supported) -- Dialects. I could write a program using the English
Dialect, then change to the Japanese Dialect and all the keywords and syntax
structure would be magically translated (in 2-byte SJIS, of course; not a
big leap to Unicode). Very cool.
Do I detect a trend here? I can just see it now, "Apple Py"! Or perhaps the
biblical serpent on the tree of knowledge would be more appropriate...
--
David Goodger dgoodger at bigfoot.com Open-source projects:
- The Go Tools Project: http://gotools.sourceforge.net
(more to come!)
More information about the Python-list
mailing list