[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal #3 for MacLISP characters...
- To: LISP-FORUM
- Subject: Re: Proposal #3 for MacLISP characters...
- From: Kent M. Pitman <KMP at MIT-MC>
- Date: Sat ,16 Aug 80 20:18:00 EDT
I submit the following as a possible plan for Maclisp characters as it
describes a useful functionality without extremely little overhead.
For Maclisp, we could even CONS a set of fixnums (values #o0 through #o177
which were unique from the ones normal read would give). (Mis)Features:
* #/A ... etc could return those. INCH could also return from that table.
* The printer could know about them -- or at least GRINDEF.
* CHARACTERP or whatever could obviously be trivially defined and would
be useful for debugging. In compiled code, it would probably want to just
be a FIXP test tho'.
* `Character' fixnums would not be EQ to `normal' fixnums (this was never
previously guaranteed anyway) but the mathy operations would still work
* CHAR-UPCASE or whatever you call it could return a `character' fixnum
but if you did normal math (getting back a normal fixnum) you'd have an
object which still worked ok for maclispy operations, but which OUCH could
be made to complain about non `character' fixnums -- good for debugging
code to be later moved to less tolerant systems. (TYI would of course take
either kind of fixnum.)
* FIXP would still return T, so CASEQ would not complain about using
characters. ... Some other code which wanted characters to not be FIXP
would possibly lose -- I suspect such code would be in the minority
and hope that most such code would still usefully accept fixnums. eg,
(DEFUN FOO (X)
(COND ((CHARACTERP X) ...)
((FIXP X) (FOO (CHARACTER X)))