2 ms·
That's part of Common Lisp. By default the reader is case-insensitive and upcasing -> the internal representation is case-preserving. If we escape characters in
by lispm 8y ago
That's part of Common Lisp. By default the reader is case-insensitive and upcasing -> the internal representation is case-preserving. If we escape characters in a symbol or even the whole symbol, those preserve their case.
But one can for example configure the READER in Common Lisp to use different modes - for example fully case preserving. The built-in CL symbols will stay in uppercase - because that's how they are defined.
CL-USER 32 > (setf (readtable-case *readtable*) :preserve)
:PRESERVE
CL-USER 33 > (DEFUN This-Is-A-Symbol (VarIable)
(SIN VarIable))
This-Is-A-Symbol
CL-USER 34 > (This-Is-A-Symbol 7.4)
0.89870817
CL-USER 35 > (THIS-IS-A-SYMBOL 7.4)
Error: Undefined operator THIS-IS-A-SYMBOL in form (THIS-IS-A-SYMBOL 7.4).
As you can see, we can then program with case preserved syntax and use the uppercase built-in symbols like DEFUN or SIN.