<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">I've been stumped by trying to understand why:</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div>? (type-of -3)<br>FIXNUM<br>? (type-of 3)<br>(INTEGER 0 1152921504606846975)<br>?</div><div><br></div><div dir="ltr" data-setdir="false">return different types. I know that type-of is somewhat ill-defined, but in my reading of the spec, '3' should also be a fixnum, since it is between most-negative-fixnum and most-positive-fixnum. CLtL2 suggests that implementors return the most specific type, and that would also be fixnum. Steele later points out some flaws in the current specification of type-of. Both CCL and SBCL exhibit this behaviour.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Two questions for the smart ones out there:<br></div><ul dir="ltr" data-setdir="false"><li>Is there something in the spec that I missed that makes type-of behave this way?</li><li>Is there a way to do a type checking assertion for fixnums that works with both positive and negative integers? I am trying to optimize some numerical functions.<br></li></ul><br></div></div></body></html>