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

Re: DIGITP



Okay, okay, I give up!  I agree that having two functions DIGITP
and DIGIT-WEIGHT is all right, and leave it to a very smart
compiler to optimize the case of
	(COND ((DIGITP X) (HACK (DIGIT-WEIGHT X)))
to avoid duplicate work if it thinks it is worthwhile, which it probably
isn't anyway, I guess.
I propose that DIGITP nevertheless return the weight of the digit
if the argument is in fact a digit, and that DIGIT-WEIGHT blithely
assume that it not only has a character in hand, but in fact a digit,
so that in the case of the above COND a compiler which open-codes
would know that (a) the call to DIGITP actually is "for predicate"
and so need not generate the weight, and (b) the call to DIGIT-WEIGHT
may be open-coded as GSB suggested.