[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generic types vs. specific types



    It would be a bad idea to have a different data type
    for characters if that means that all the fine old numeric
    functions don't work on them.  The user should not have
    to have a whole new set of CHAR-+, CHAR-<, CHAR->, CHAR--,
    CHAR-LOGAND, CHAR-BOOLE, etc, etc.

Suppose that I, for some reason, WANT to write a portable Lisp editor
that wil work on an EBCDIC system.  In general, suppose that I want to
write code that will work in any character set.  In taht case, I have
no business doing CHAR-BOOLE; it is obviously not a meaningful or
defined thing to do to a character.  Of the functions you mention,
indeed CHAR-< and CHAR-> would be needed (although if > works on
fixnums and flonums and bignums equally well there is no reason
for it to go to the trouble of failing on character objects),
because the concept of a collating sequence is usually useful
and well-understood.

Let me repeat that whatever happens, I would like to see defined Lisp
functions to do all those things we usually do by doing arithmetic on
characters, such as uppercasing, converting from numbers to digits (as
in (+ #/0 x)) and so on.  Having these functions, and defining them
consistently with NIL, plus the inclusion of some NIL-compatible
identity macros, MIGHT be all we need to resolve this whole question.