Case-sensitivity goals, policy and implementation



I think you have an excellent point, discussed ad-nauseum by
the Franz Inc. people.

My personal take on this is:  if you believe your code is
case insensitive,  (that is x=X and you use them interchangeably),
then before I do anything else with your code
I run it through a filter that converts all letters
to lower case. I then throw out your original code to avoid
further confusion. This can be done in one command line in unix.

If I write case-sensitive code in which x and X must mean
different things, then I am deliberately being non-transportable
to certain other peoples' domains. This could be considered
either inconsiderate, or progressive.  I might also use unicode,
in which there are like a zillion "cases".

I could, if I wished to be transportable, write in all lower case.

As a matter of course, I write programs in all lower case, so
this does not matter for my code.  And I would simply not use your
code that had x and X being the same without running it through
(I think...  tr A-Z a-z <oldfile >newfile ;  or some emacs command
like downcase-buffer).

So code could be easily exchanged except if S (see below) insists that
he must write code that explicitly requires x and X to both exist
and be different, and he is trying to prove something important by it, and
is willing to limit his user community and specifically
cut out of consideration people who randomly hit the
shift key when typing programs or data. :)

RJF

Albert Reiner wrote:

>[ Dudley, Jeremy <Dudley_J@wrcplc.co.uk>, Mon, 11 Oct 2004 14:31:31 +0100]:
>  
>
>>>"In maths, I am used to case sensitivity. As a simple example, 'a'
>>>being a vector and 'A' being a matrix. In programming, I loathe
>>>case sensitivity. I want 'a' and 'A' to be the same, not a cause
>>>for confusion; too often do I type something like 'COmmon' when I
>>>want 'Common.' In a language that demands variable declaration
>>>this can be picked up, at least to some extent.  Maxima does not
>>>demand such an approach, so the risk of propagation of mistakes
>>>seems too high."
>>>      
>>>
>
>(Chiming back in, again for myself:)
>
>[Richard Fateman <fateman@cs.berkeley.edu>, Mon, 11 Oct 2004 08:07:19 -0700]:
>  
>
>>A flag to the reader program in Maxima that says:
>>when I type in to the top level, convert all my
>>characters to lower case.  Thus cOmMoN  would become
>>common before processing. The output would be simply
>>common.
>>
>>The name of the flag might be
>>downcase_all_input.   Or maybe  DoWNcASe_All_INPuT :)
>>    
>>
>
>ISTM that this approach suffers from the difficulty that you then
>cannot know what setting the user prefers.  Say a case-sensitivist S
>writes some Maxima code a case-insensitivist I wants to use it.  I can
>only see the following possibilities:
>
>- things break as S thought that x and X are different (seems most likely);
>
>- I needs to do block(downcase_all_input: false, load("...")) and then
>  ends up with a mixture of case-sensitivity and -insensitivity,
>  however things are made to work; or
>
>- S cannot count on x and X being separate symbols.
>
>The other way round, if I writes some code to be used for S, we have
>either
>
>- things break as I had no reason to suspect that x and X are not the
>  same (seems most likely);
>
>- S needs to do block(downcase_all_input: true, load("...")) and then
>  ends up with ugly all-lowercase[1] symbols; or
>
>- I cannot count on x and X being the same.
>
>Either way, this comes with considerable cost and is likely to hamper
>the easy exchange of code; in addition, it seems this might make it
>more difficult to call Maxima from Lisp as you have to worry about
>calling $FOO or |$foo| etc - after all, Common Lisp is case
>sensitive.  Seems like the worst of both worlds to me.
>
>I personally do not care whether Maxima is case sensitive or not, but
>mixing both is confusing and IMO certainly not worth the cost,
>irrespective of a downcase_all_input flag.
>
>Regards,
>
>Albert.
>
>
>[1] Actually, to facilitate using things from Lisp it should probably
>    UPCASE the symbols.
>
>
>  
>
>>:Albert Reiner wrote:
>>    
>>
>
>Actually, no:  Jeremy Dudley wrote:
>
>  
>
>>>    [ Posting this on behalf of "Dudley, Jeremy" <Dudley_J@wrcplc.co.uk>,
>>>      whose posting from Mon, 11 Oct 2004 14:31:31 +0100 was rejected: ]
>>>      
>>>
>