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

EQ-ness of fixnums



From:     PSZ@MIT-ML
Date: Sun, 28 Apr 80 02:00:19 GMT
Original-Date: 04/27/80 22:00:19 EDT
Subject: Re: EQ-ness of fixnums
    I know that exactly which MacLISP fixnums are EQ varies with time and is
    not generally counted on.  Is it considered tasteless to build code that
    figures this out and depends on it as an efficiency hack?  Do LML, NIL,
    Multics Maclisp,... take any position on this?  Would it be reasonable
    to define a NUMBER-TESTS-AS-EQ predicate (or equivalent)?

I don't know about tasteless, but before you write any such code you
should know that even for small fixnums EQness of numbers doesn't
always work in compiled code.  The situations are hard to explain
briefly, but you should check out the issues before going any further.
I believe there is a paper describing the way complr hacks fixed point
aritmetic that will help you here.

On the LispMachine you can always count on EQness of all fixnums (even
in compiled code), and to do so is quite tastfull.

On Multics EQness of all fixnums certainly works in the interpreter,
and I don't think the compiler can violate it either, but I personally
would consider such a use distastefull since the dialect of Lisp is
supposed to still be MacLisp, and such a hack might not work on ITS.

I don't know about NIL.