Case sensitivity (was Conjugate is weird)



--- Raymond Toy <toy@rtp.ericsson.se> wrote:
> >>>>> "CY" == C Y <smustudent1@yahoo.com> writes:
> 
> > Um.  I guess I didn't express myself very well - anything
> > written for inclusion in Maxima would need to be written in such a 
> > way as to not depend on case.  
> 
> If you have user-selectable case sensitivity, I don't see how you can
> write code that doesn't depend on case.  My case-insensitive foo is
> going to collide with your case-sensitive foo.  (Or is that FOO?)

As I'm seeing this, there are two cases:

1. case sensitive user uses code written in insensitive code.  

   This isn't a problem, provided the file saved and exchanged converts
everything to lower case.  The case sensitive lower case foo works the
same as the case insensitive foo, and a properly saved case insensitive
foo won't ever contain FOO.  Maxima's job in saving a case insensitive
file would be to make sure of that.  Perhaps the Shift key could even
be disabled for letters when Maxima is in case insensitive mode.

2. case insensitive user uses code written as case sensitive code.

    In this case, the load mechanism in Maxima notices that the user is
in case insensitive mode and automatically translates all capital
letters into cap_#, e.g. R -> cap_r  or maybe even c_r.  Code works
fine , and when saved can either retain this notation or translate back
into capital letters.  

If Maxima does the work the user won't have to mess with it.

>     CY> load("filename", cs);
> 
> I'd rather not have to think about this at all.

You don't need to actually - Maxima should be smart enough to figure it
out by itself.  I hadn't thought it all the way through.

>     CY> if the command is given just as load("filename") without the
> toggle,
>     CY> Maxima will check the file to see if the information is
> recorded there,
>     CY> and if not assume the file matches the user's environment. 
> Perhaps it
>     CY> could even scan for upper case letters in the case of running
> in case
>     CY> insensitive mode.
> 
> I suppose that's possible to do, but the information MUST be in the
> file.  It would be bad if maxima has to make assumptions.  

It should be a simple case of checking for non-comment capital letters,
and translating them appropriately.  

> I can see it now---your carefully computed foo variable of 100 pages 
> has just been zapped because you loaded my virus package that sets
foo 
> to %pi.  :-)

That can happen anyway :-).  Actually, I know you ment that as humor,
but it does raise a point I hadn't considered before.  Does anyone know
if Lisp implimentations potentially have root exploits?  It's probably
not a big deal but I've never even considered it before. 

> Personally, I think most people would be happy if maxima printed out
> everything in lower case and wasn't case-sensitive.  But I'm
> biased. :-)

I don't blame you.  That's why I think this is worth a little effort. 
Lots of people like one method over another, and I'm not seeing any
fundamental reason we couldn't accomidate it in a fairly
straightforward manner.

CY

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com