[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more on mixed case



  People will always establish conventions which permit them to get their
ideas across in the shortest amount of time.  The function KMP wrote
named `Car' would be pronounced `capital car' here and there would
be no confusion between that and the one pronounced `car'.  Admittedly
there is no convention for pronouncing `cAr' but if we every found 
ourselves writing things like this, then someone would find a way to
pronounce it.  I think that you are exaggerating the communication problem.
Suppose I wrote this function:
 (defun macrop (FunctionName)
	(and (getd FunctionName) 
	     (or (and (bcdp (getd FunctionName))
		      (eq 'macro (getdisc (getd FunctionName))))
		 (and (dtpr (getd FunctionName))
		      (eq 'macro (car (getd FunctionName)))))))

Now suppose word gets around about my great new function to tell if a
function is a macro or not. Someone asks me how it works. I say "
it takes functionname as an argument, checks to make sure functionname
has a function binding and then if its binding is a binary object ..."
I don't have to tell him that functionname is written FunctionName,
that is totally irrevalent.  And in fact, most of the symbols in most
lisp programs are local variables, and many functions in lisp
files are local to one file and thus the author should be able to
write them for maximum readability to himself.  
  Ok, you never use GRIND anymore (neither do we), but you do use 
compilers and I believe that the error messages from the compiler 
should use the representation the programmer used when printing errors 
and warning. 
  While the case doesn't affect the meaning in English, it does convey
information.  There is a difference between writing "you are wrong" and 
"YOU ARE WRONG".  Aren't you a bit offended when someone writes a passage
in capital letters, ISN'T IT JUST LIKE THEY ARE YELLING AT YOU?
The use of the same letters with different casification (??) can be very
helpful in distinguishing functions with the subtle differences in 
meaning. I can see someone wanting to use KMP's Car function in his
code as well as the standard car.  In a one system where the default
is to single case things, you would have to call Car something else
or have to escape the lower case characters, both options would
result in an uglier program (very personal opinion).
  Multics has had some growing pains but that is to be expected. 
The use of both cases in names which must be used by many users
or between computers must be controlled.  I guess that we have
done pretty well here because I haven't heard any complaints.
 
 This whole issue extends beyond Lisp.  The other languages we run
here treat cases distinctly (except Fortran and Pascal when it is
put in `Standard Pascal' mode).  Most people tend to use mixed
cases in their code although there are very few places in the
system libraries where mixed code is used.  One convention in 
C is to use all upper case to denote a macro.  I have randomly
searched through directories and come up with a segment from
a typical C program and a typical Model program to demonstate 
their use.  Most typical is the use of case to delimit words rather
than other seperators, such as underscore.

C program segment:

    (void) PSetPath("/dev");
    if (display == NULL) error("no display specified (-g<display>)");
    grtty = POpen(display, "w", (char *) NULL, (char **) NULL);
    if (grtty == NULL) error("couldn't open display");
    (void) PSetPath(path);


Model program segment:
MakeCopyOnly inline beginproc
	formal copyOnly{t, s} c (varies); integer i (varies); noresult;
	copyOnlyData temp;
	temp.data := i;
	c := temp \ copyOnly{t, s};
endproc;