From: Martin J. Zaidel
Subject: Case-sensitive Reader in Lucid 4.0
Date: 
Message-ID: <55498@netnews.upenn.edu>
I'm trying to preserve the case of the characters read in from input.
CLtL2 describes the function READTABLE-CASE (p.549), an access function
to the readtable-case slot of the current readtable.  This function
exists under Lucid 4.0, but I cannot use it within a setf to change the
slot (as described in CLtL2):

> (setf (readtable-case *new-readtable*) :preserve)
>>Error: READTABLE-CASE is not a known location specifier for SETF

Does anyone know of it's possible to set the readtable-case slot of a
readtable in Lucid?  If not, any suggestions on how I can preserve
the case?

Thanks,

Martin J. Zaidel               *  I don't think I have all my sh*t together,
==> ······@cis.upenn.edu       *  but I think I can see it all at least.
                               *  

From: David Gadbois
Subject: Case-sensitive Reader in Lucid 4.0
Date: 
Message-ID: <19911106235026.6.GADBOIS@CLIO.ACA.MCC.COM>
    Date: Wed, 6 Nov 1991 11:53 CST
    From: ······@muzungu.cis.upenn.edu (Martin J. Zaidel)

    [...]

    Does anyone know of it's possible to set the readtable-case slot of
    a readtable in Lucid?  If not, any suggestions on how I can preserve
    the case?

The current versions of Lucid are not very ANSI supportive, and, in
particular, their readtables do not handle the case stuff.  Lucid claims
that they will fix this in the 4.1 release.

As a workaround, you have to do the sleazy trick of making all the
characters you are interested as having as constituent characters macro
characters that dispatch to a custom reader.  The following code will
work for purely alphabetic symbols if you do not stress it too hard:

#+Lucid
(progn
  
(defvar *case-sensitive-readtable* (copy-readtable))

(defun non-upcasing-symbol-reader (stream char)
  (intern (coerce
	    (cons char
		  (loop for next-char = (peek-char nil stream nil nil t)
			while next-char
			do
		    (multiple-value-bind (macro-function non-terminating-p)
			(get-macro-character next-char *case-sensitive-readtable*)
		      (if (or (and macro-function
				   (not non-terminating-p))
			      (whitespacep next-char))
			  (lcl:loop-finish)
			  (read-char stream t nil t)))
			collect next-char))
	    'string)))

(loop for code below char-code-limit
      as char = (code-char code)
      when (alpha-char-p char)
	do (set-macro-character char #'non-upcasing-symbol-reader t *case-sensitive-readtable*))
)
From: Martin J. Zaidel
Subject: Re: Case-sensitive Reader in Lucid 4.0
Date: 
Message-ID: <55543@netnews.upenn.edu>
In article <·····@netnews.upenn.edu>, ······@muzungu.cis.upenn.edu
(Martin J. Zaidel) writes:
|>I'm trying to preserve the case of the characters read in from input.
|>CLtL2 describes the function READTABLE-CASE (p.549), an access function
|>to the readtable-case slot of the current readtable.  This function
|>exists under Lucid 4.0, but I cannot use it within a setf to change the
|>slot (as described in CLtL2):

Big-time "oops" here.  It turns out that this function is defined in
ilisp, not in Lucid.  Bet I had 'em scratchin' their heads at Lucid:
"Did you defun that?  I didn't defun that." :-)

Sorry.
                   
Martin J. Zaidel               *  If a train station is where a train stops,
==> ······@cis.upenn.edu       *  what happens at a workstation?
                               *  
From: Frank Yellin
Subject: Re: Case-sensitive Reader in Lucid 4.0
Date: 
Message-ID: <FY.91Nov7094647@hardwick.lucid.com>
 
In article <·····@netnews.upenn.edu> ······@muzungu.cis.upenn.edu
(Martin J. Zaidel) writes: 

>   Big-time "oops" here.  It turns out that this function is defined in
>   ilisp, not in Lucid.  Bet I had 'em scratchin' their heads at Lucid:
>  "Did you defun that?  I didn't defun that." :-)

No.  Not really.  I defun'ed both of 'em.  
				  *  
I was just trying to figure out what sort of image you could possibly be
running that had one and not the other.

Frank Yellin
··@lucid.com