Case sensitivity/insensitivity

Bjorn Pettersen bjorn at roguewave.com
Mon May 22 12:12:56 EDT 2000


"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.
> 
> ("is" can also be spelled as "=" if one wishes).
> 
> And to make AppleScript a bit more fun, there is also
> ignoring diacriticals
>    ...
> end ignoring
> 
> The latter construct allows, eg,  o mit umlaut (which I'm not going to
> attempt over Usenet) to equal plain o, so we could have one
> in one of the tokens above.  The default considers diacriticals and
> ignores case.
> 
> So certainly the Alice folks who had been exposed to AppleScript
> would have expected 'token' == 'Token'.

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
    ...

hey, it's much easier for every Norwegian speaking person (and I'm sure
the f-bot can read it too ;-)

trying-my-hardest-to-get-the-discussion-off-track'ly y'rs
-- bjorn




More information about the Python-list mailing list