Subject: Re: Uppercasing symbols
From: Erik Naggum <erik@naggum.no>
Date: 1998/12/06
Newsgroups: comp.lang.lisp
Message-ID: <3121908890689253@naggum.no>

* Kent M Pitman <pitman@world.std.com>
| Incidentally, if memory serves me, the reason that uppercase was
| originally the canonical case in computers when character codings were
| narrow enough to have only one case is that the name of the deity was not
| to appear in lowercase.

  not that I ever discussed religion on the old telex machines my first
  real employer used back in 1979/80, but they _were_ all lowercase.  it's
  also my _impression_ that the old Teletype was all lowercase, but I can't
  say for sure.  what I do know, however, was that on the mainframes of the
  time, the canonical case was uppercase.  the Cyber computers were short
  one bit of a real character code, and they had all uppercase.  the DEC-10
  had 7-bit codes, and even 8- og 9-bit codes if you really wanted it to,
  but still uppercase was the canonical case.  I used TOPS-10 and TOPS-20
  back then, and we had to quote lowercase letters in filenames with ^V.
  (but tell this to the kids these days, and they won't believe you.)

  I also observe a change towards less uppercase characters in general.
  magazine and newspaper heads move towards lowercase.  company logos and
  trademarks are moving to all lowercase, too.  dictionaries used to be
  published with capitalized headwords -- that's history, too.  "Lisp" used
  to be written LISP, then L<small-caps>ISP</small-caps>, then Lisp, the
  same as Unix.  my own style is to maintain the case of the word in
  electronic text regardless of its position in a sentence, rather than
  force an information-losing upcase on the first letter of the sentence.
  (thus the deity has nothing to fear from me.)

  on the Net, domain names used to be written in uppercase.  now they are
  universally written in lowercase.  fortunately for us all, the DNS is
  case insensitive.  mail addresses used to be in uppercase, too, but the
  standards decreed that the local-part of a mail address not be munged.

  this is actually _not_ an argument for changing the canonical case of
  Common Lisp symbols.  all we need is a slightly better way to ensure that
  we can still talk about symbol in lowercase.  currently, however, we may
  have to expose the uppercaseness of symbol names when constructing them
  on the fly with INTERN.  this may be a good time to promote my #" reader
  macro, which reads the following symbol (which must end in a ", too, and
  case-translates as it would do for a symbol, but return the string
  without ever interning the symbol.  it's particularly easy to implement
  in Allegro CL:

;;; reader for symbol names that does case conversion according to the
;;; rest of the symbol reader.  thanks to John Foderaro for the pointer.

(defun symbol-namestring-reader (stream character prefix)
  (declare (ignore prefix))
  (prog1 (excl::read-extended-token stream)
    (unless (char= character (read-char stream))
      (excl::.reader-error stream "invalid symbol-namestring syntax"))))

(loop with readtables = (excl::get-objects 11)
      for i from 1 to (aref readtables 0)
      for readtable = (aref readtables i) do 
      (when (excl::readtable-dispatch-tables readtable)
	(set-dispatch-macro-character #\# #\" 'symbol-namestring-reader readtable)))

  this latter part actually affects all your readtables.  you may have
  valid reasons not to want that.  this is best suited for customizations
  prior to dumping a new Lisp.

  this means you can write (apropos #"eric-fun").  I think this is cool.

#:Erik
-- 
  The Microsoft Dating Program -- where do you want to crash tonight?