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

Re: R5RS Proposal proposal (bitvectors)

   Date:	Tue, 26 May 1992 14:13:57 -0700
   From:	"Michael R. Blair" <ziggy@martigny.ai.mit.edu>

   I just want to be able to have bitvectors and bitwise logical AND
   and OR and NOT and so on. This is partly because I simulate digital
   chips and partly because I am envious of other languages that claim
   high efficiency algorithms by using bitvectors to scoreboard things
   like set operations (union/intersection/etc as OR/AND etc).

I would prefer not adding a new data-type but rather just specifying the
various bitwise operations on (exact) integers in much the same way Common Lisp
does, with integers treated as if they were half-infinite two's complement bit
sequences.  I'd like to see LOGAND, LOGIOR, LOGXOR, and LOGNOT, with the first
three being binary operators (or perhaps n-ary) and the last being unary, all
mapping exact integers to exact integers.

Common Lisp provides both these operations on integers and logical operations
on (mutable) bit-vectors.  I find the integer variety to be much simpler to
understand (mainly due to their immutability, I think), but I can see the
usefulness, in certain contexts, of a mutable variety too.  I guess what I'm
saying is that I certainly want the integer ops and wouldn't squawk too loudly
if bit-vectors were added too.