[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue: READ-CASE-SENSITIVITY (Version 1)
- To: Kent M Pitman <KMP@scrc-stony-brook.arpa>, cutting.pa@xerox.com
- Subject: Re: Issue: READ-CASE-SENSITIVITY (Version 1)
- From: Jeff Dalton <jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK>
- Date: Thu, 16 Feb 89 15:41:29 GMT
- Cc: CL-Cleanup@sail.stanford.edu, richard%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK
> 3. *READTABLE* is already powerful enough to provide what you need
> if only there were a way of suitably modifying a readtable.
>
> I think someone should therefore instead propose that we introduce some
> operation like SET-CHARACTER-CASE-TRANSLATION (or perhaps something more
> general like Genera's SET-CHARACTER-TRANSLATION, which I think -- I didn't
> look up its documentation recently -- allows you to say that arbitrary
> chars are translated to arbitrary others).
I would be perfectly happy with such a proposal. I am surprised,
though, that my suggestion is as controversial as it seems to be.
Right now I can change the operations of READ in lots of ways, by
setting the input base, by defining macro characters, and so on. I
don't see why a simple thing like case sensitivity is such a problem.
Indeed, you don't really seem to think it is, for you seem willing to
have it done by the read table, just not by a new parameter.
Some of your arguments are against the whole idea of case-sensitivity,
others against the addition of *READ-CASE*, and others against the
admittedly somewhat peculiar interpretation of :UPCASE and :DOWNCASE
(but I think the interpretation of these values for *PRINT-CASE* is
also not what one would immediately expect). This mixture is
confusing. At some times, it seems that you hate every aspect of the
proposal, but at others that all you really dislike is the the
addition of a new parameter (admittedly a problem that is not just
aesthetic) and the particular keyword values I propose.
One reason I proposed a parameter rather than a readtable operation
was that it seemed more consistent with the way the rest of Common
Lisp worked. (And, I suppose, because some other Lisps worked that
way.) BUT, I don't really want to argue this point. Indeed, I now
would say I was wrong.
However, I had to pick one of the many possible proposals as a
starting point, and the addition of a new parameter looked simpler
that trying to handle all the versions of readtable operations.
I tried to at least hint at other possibilities at various
points, but I didn't want to write a complicated proposal that
considered everything until I had some feedback.
As for the issue of case distinctions in code, I did expect that to
be controversial. But I don't want disputes of that sort to doom
a facility that is also useful in applications.
I do not actually find the arguments for using case distinctions in
Lisp code all that important (perhaps because I don't expect to do it
myself), but it is definitely useful for applications to be able to
use READ in a case-sensitive way. The difficulty of doing this has
come up again and again (at least here), and it is difficult to
explain why Common Lisp does not provide this capability in any
reasonable way, especially since it provides much more powerful
things such as character macros.
However, one of my reasons for submitting this proposal was simply to
make the rationale explicit. And there your messages are very
helpful. I didn't try to make every point for and against myself,
because I hoped the discussion would do some of it for me. I don't
think I completely overlooked the points you've raised, but I didn't
try to put them all in the proposal, and we obviously assign them
different weights. Now I'd like to revise and try again. (Well,
actually I'll wait 'till the dust settles a bit.)
Although this issue is in some ways trivial, I do think it is
important.
-- Jeff