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

Problem with BIT-VECTOR-POSITION



BIT-VECTOR-POSITION fails when (1) the vector contains more than 32 bits,
(2) the :START arg picks a place not in the last word of the vector,
and (3) there is a bit in the last word.  The value returned is the
location MOD 32 of the last bit.

I'm wondering whether there is an "official" patch for this problem and,
if so would someone send it to me.  I have a simple fix but am not
sure if it works when the array has been displaced (can bit vectors can
be displaced arrays?).

Here is a case that fails:
	(SETQ BITS (MAKE-ARRAY 40 :ELEMENT-TYPE 'BITS))
	(SETF (BIT BITS 20) 1 (BIT BITS 33) 1)
	(LOOP WITH I = 0
	      DO (SETQ I (BIT-VECTOR-POSITION 1 BITS :START I))
	      WHILE I
	      DO (PRINT I)
	         (INCF I))

This code goes into an infinite loop printing alternating 20's and 1's

Jeff Barnett

PS. Customer reports, unless your mailer has been fixed recently,
you should reply to me at JBARNETT@NRTC.NORTHROP.COM insteasd of
what you see in the from header field.