Subject: Re: ACL 6.0 Trial Edition ships with non ANSI reader behavior.
From: Erik Naggum <erik@naggum.net>
Date: 06 Nov 2000 02:58:09 +0000
Newsgroups: comp.lang.lisp
Message-ID: <3182468289670750@naggum.net>

* John Foderaro <jkf@unspamx.franz.com>
| The current situation is that most people out there are using 
| lisps in ANSI mode and producing ANSI-only code.

  Well, if they perform the following operations on their Modern Lisp,
  they will get the best of both worlds:

(progn
  ;; Turn _off_ the internal flag which overrides the readtable-case.
  (setq excl::*forced-readtable-case-raw* nil)
  ;; All readtables will now have :upcase as the readtable-case which
  ;; will break since all symbols are still in lower-case, so we need
  ;; to fix them all.  This is a little brutal, but what the heck,
  ;; this is a demonstration that Allegro CL can operate within the
  ;; standard without the internal hackery and respect readtable-case
  ;; the way it was meant to be treated.
  (loop with objects = (excl::get-objects 11)
      for index from 1 to (aref objects 0)
      for object = (aref objects index)
      do (setf (readtable-case object) :preserve)))

  If you want :downcase, remember to set *print-case* to :downcase if
  you want to _see_ the new lower-case symbol names.  Put this in your
  .clinit.cl file, too:

(tpl:setq-default *print-case* :downcase)

  We now have a Common Lisp with lower-case symbol (and package) names
  that respects the value of readtable-case.  Whee!

(9) cl-user
(symbol-name 'car)
=> "car"				;as expected
(10) cl-user
(setf (readtable-case *readtable*) :downcase
      *print-case* :upcase)
=> :UPCASE				;just for kicks
(11) cl-user
(SYMBOL-NAME 'CAR)
=> "car"				;as expected
(12) cl-user
'car
=> CAR					;this, too
(13) cl-user
(setf *print-case* :downcase)
=> :downcase				;return to normal
(14) cl-user
'car
=> car					;as expected

  I'm not sure I have a _complete_ understanding of _all_ that this
  _remarkably_ simple change shows, but the need for the internal
  hackery is _gone_, the standard _is_ powerful enough to handle this
  new situation, Allegro CL does not operate any differently at all
  with these settings (running the test suite reports no changes), and
  it seems that the need to destroy the working of readtable-case has
  been _thoroghly_ debunked.  Just stop lying, do the right thing, and
  both Allegro CL and Common Lisp are in fact up to the task.  Amazing!

  So I have found a way (for now!) to survive John's ploy to undermine
  the standard, and as long as it is _this_ simple, I can continue to
  recommend Allegro CL for people who want to program in Common Lisp,
  including those who think the whole language would be so much better
  off if the symbols were all lower-case instead of all upper-case.

  Best of all, now people can try out a Common Lisp that _obeys_ the
  standard's printer control variables, but with an isolated change to
  the Allegro CL and Common Lisp universe.

  Probably not a good lesson to learn, but sometimes getting really,
  really annoyed with some bonehead decisions other people make can
  have interesting and constructive results.  Shit, this case-mode
  cruft has annoyed me for years, but in 6.0 at least they have fixed
  the standards-conforming code sufficiently that I can live with it.
  In 5.0, the purportedly standards-conforming code was so broken this
  would not have worked correctly.

  Not that the reader and printer work 100% correctly, still, but at
  least the major blockage to progress has been completely _excised_,
  if not exorcised.

  OK, so I'm gloating.

#:Erik
-- 
  Does anyone remember where I parked Air Force One?
                                   -- George W. Bush