[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DIGITP again, already
- To: jonl at MIT-MC, nil at MIT-MC, bug-lisp at MIT-MC
- Subject: DIGITP again, already
- From: Guy.Steele at CMU-10A
- Date: Tue, 23 Sep 80 14:57:00 GMT
- Original-date: 23 September 1980 1057-EDT (Tuesday)
From: JONL at MIT-MC (Jon L White)
... It looks as
if you are still confusing the (static) division of the alphabet
with the (dynamic) action of the reader; the major point that
you've apparently missed is that a typical reader has to do something
like the following piece of code anyhow (at least if its input radix
is variable):
(AND (SETQ VAL (DIGITP CHAR))
(< VAL <input-radix>))
[It is for this very reason that I wanted to give DIGITP an optional
argument defaulting to 10. Then (DIGITP x) corresponds to the "naive"
notion of x being a digit--namely one of the characters in the set
{0,1,2,3,4,5,6,7,8,9}--making it very easy for the novice to use this
extremely common case; while (DIGITP x IBASE) is precisely what the
reader needs. (Actually, it would cause 8 not to be a digit in octal
radix, which is actually "a right thing" if not "the right thing", but
we are all used to abusing that--sigh.) I don't think anyone is ever
really interested in whether a given character can EVER be a digit,
under any conceivable circumstances--but perhaps (DIGIT x ()) could
serve that purpose. Finally, ought (DIGITP x 'ROMAN) do anything
useful??
--GLS]