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

Logical Operations on Numbers



    Date: Sat, 14 Jan 89 19:57:36 PST
    From: Jon L White <jonl@lucid.com>

    For what it's worth, Johan DeKleer at Xerox PARC asked for just such
    functionality back in 1984.  I don't remember what the public response
    was then -- I seem to remember everyone trying to write clever, short
    code sequences that would "do the trick".  But the gaping hole still
    stands.  If just one more person seems to thinkg it is a good idea,
    then that should carry much force with the X3J13 committee.

    -- JonL --

Logical subsetp is in the critical path of a peephole optimizer i just
wrote.  For efficiency reasons, though, the code was reorganized so that
in any given instantiation the size was fixed, and some complicated
macrology ends up turning things into manipulation of lists of fixnums.
(here's an application for the fixnum type which can enhance
portability...)

I could see having this kind of predicate for both integers and
bitvectors, and could imagine a sufficiently powerful compiler handling
it (and other bit and logical operations) efficiently.