From ... Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!news.tele.dk!129.240.148.23!uio.no!Norway.EU.net!127.0.0.1!nobody From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: ACL 6.0 Trial Edition ships with non ANSI reader behavior. Date: 06 Nov 2000 02:58:09 +0000 Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net Lines: 87 Message-ID: <3182468289670750@naggum.net> References: <3182371042747250@naggum.net> <3182446271277745@naggum.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: oslo-nntp.eunet.no 973483548 4399 195.0.192.66 (6 Nov 2000 04:05:48 GMT) X-Complaints-To: newsmaster@eunet.no NNTP-Posting-Date: 6 Nov 2000 04:05:48 GMT mail-copies-to: never User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Xref: supernews.google.com comp.lang.lisp:3281 * John Foderaro | 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