[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue: READ-CASE-SENSITIVITY (Version 1)
- To: Jeff Dalton <jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK>
- Subject: Re: Issue: READ-CASE-SENSITIVITY (Version 1)
- From: David N Gray <Gray@DSG.csc.ti.com>
- Date: Wed, 22 Feb 89 12:25:55 CST
- Cc: pierson <@multimax.encore.com:pierson@mist.encore.com>, KMP@scrc-stony-brook.arpa, CL-Cleanup@sail.stanford.edu
- In-reply-to: Msg of Mon, 20 Feb 89 17:25:45 GMT from Jeff Dalton <jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK>
- Sender: GRAY@Kelvin.csc.ti.com
> But it's nontrivial to design something of this sort. The options seem
> to be:
>
> * some way just to turn case concersion on and off
> * a way to specify a conversion for every character
> (normally, some would be converted to upper case)
> [I can imagine lots of objections to this since
> it would make readtables bigger, it would have to
> say what happens when one of the characters is
> defined as a macro, etc.]
> * define some way for character macro functions to return
> a substitute character (or characters?).
> * [maybe] specify an alternative character set that doesn't
> have case conversion.
>
> Any preferences?
I notice that our reader calls CHAR-UPCASE on characters which the read
table defines as possible constituents of a symbol name. Suppose that
instead of a hard-coded call to CHAR-UPCASE, it FUNCALLed a function
contained in the read table, with #'CHAR-UPCASE being the initial value
in the standard read table. That would be a very simple change, but would
give you all the flexibility you might want. The only drawback is that it
could slow the reader down, since our call to CHAR-UPCASE is actually
expanded inline now.
I like the idea of doing things like this as keyword arguments to
COPY-READTABLE, both to avoid inventing new function names and to protect
the standard readtable from alteration. For example:
(DEFPARAMETER *CASE-SENSITIVE-READTABLE*
(COPY-READTABLE *READTABLE* NIL
:SYMBOL-CHAR-TRANSLATION #'IDENTITY))