Re: Case-sensitivity goals, policy and implementation
Subject: Re: Case-sensitivity goals, policy and implementation
From: Raymond Toy
Date: Fri, 15 Oct 2004 08:27:33 -0400
>>>>> "ole" == ole rohne <ole.rohne@cern.ch> writes:
ole> Still thinking about READTABLE-CASE/READ-FROM-STRING versus explicit
ole> case translation and INTERN:
ole> I think it is good advise to let the Lisp Reader do just that (Read
ole> Lisp) - use a parser for anything else. If the macsyma/maxima
ole> developers for 30 years have resisted the temptation to call READ, I
ole> don't think this is the time to give in.
Almost all of the code was uppercase, and surely was uppercase 30
years ago. Now is not the time to give in and make it lower case!
Most of the code was written in a, uh, very eclectic style. Now is
not the time to change style! Maxima always uppercased everything on
input (until about 3 years ago). Now is not the time to make maxima
case-sensitive defaulting to lowercase!
And in this case we're not using the reader to parse anything. It is
only be used to do the desired case conversion.
ole> Secondly, by the time you've set up the readtable (with casing, macro
ole> characters and character syntax), and bound *PACKAGE*, *READ-EVAL* and
ole> friends, the effort by far exceeds writing simply:
ole> (cond ((not (some #'upper-case-p string)) (intern (string-upcase string) #:maxima))
ole> ((not (some #'lower-case-p string)) (intern (string-downcase string) #:maxima))
ole> (t (intern string #:maxima)))
Surely you saw the patch I sent. It certainly was less typing than
what you propose here, and all the other changes would be required
whether you use readtable-case or not.
And this only solves the input side. You still have to solve the
output side, with a similar and equally simple function.
However, I think the correct approach is to have a function handle the
conversion and use it everywhere. Then the function can do whatever
it feels like. This would be important if we decide readtable-case is
the right way and if gcl takes a long time to get readtable-case.
Ray