Subject: Case-sensitivity goals, policy and implementation
From: Raymond Toy
Date: Tue, 12 Oct 2004 10:25:49 -0400
>>>>> "James" == James Amundson <amundson@users.sourceforge.net> writes:
James> On Mon, 2004-10-11 at 09:08, Raymond Toy wrote:
>> Could these goals be achieved by doing basically what Lisp would
>> consider :preserve-case and :invert-case?
James> I thought about that for quite a while. :preserve-case + :invert-case is
James> precisely what I have in mind for the symbols in Maxima itself. The
James> problem is the user who wants to manipulate her/his equation describing
I may have been wrong. I think *print-case* should be left as :upcase
(the default), but the reader (for maxima code) should have a
readtable-case of :invert. Section 22.1.3.3.2.1 of the CLHS has a
table showing the effect:
READTABLE-CASE *PRINT-CASE* Symbol-name Output
--------------------------------------------------
:INVERT :UPCASE ZEBRA zebra
:INVERT :UPCASE Zebra Zebra
:INVERT :UPCASE zebra ZEBRA
Is this not what we want? We read "zebra" to become the lisp symbol
'ZEBRA, which, when printed out is "zebra".
Wouldn't this make "m" and "M" distinct?
Also, I think it would be a mistake to add any sort of complicated
rule on uppercase/lowercase. If we're really going to make maxima
case-sensitive, let's make it simple. Everything is exactly as typed
in. So "sin" will get you maxima's sin function, but "Sin", "SIN",
"sIN", etc., gets you something else.
The rule is simple: what you see is what you get. :-)
James> masses "m" and "M". I don't see any way to distinguish between the user
James> space and the system space -- at least, not beyond what I proposed
James> already.
I think user space and system space should be distinguished in some
other way. Why do we need that distinction anyway? I seldom care in
Lisp. And when I really want to know, I look at the package the
symbol is in. We could do this in maxima as well, if you take the
example someone (sorry, forgot who!) sent sometime ago, putting maxima
core code into a maxima (Lisp) package and all user input in a
maxima-user package.
But maybe I don't understand the problem.
Ray