* fixed some bugs revealed by Paul Dietz' test suite:
** ARRAY-IN-BOUNDS-P now allows arbitrary integers as arguments,
not just nonnegative fixnums;
+ ** the logical bit-array operators such as BIT-AND now accept an
+ explicit NIL for their "opt-arg" argument (to indicate a
+ freshly-consed result bit-array);
planned incompatible changes in 0.7.x:
* (not done yet, but planned:) When the profiling interface settles
;;; ZOO
;;; But that doesn't seem to be what happens in CMU CL.
;;;
+;;; KLUDGE: this is probably because ANSI, in its wisdom (CLHS
+;;; 5.1.2.5) requires implementations to support
+;;; (SETF (APPLY #'AREF ...) ...)
+;;; [and also #'BIT and #'SBIT]. Yes, this is terrifying, and it's
+;;; also terrifying that this sequence of definitions causes it to
+;;; work.
+;;;
;;; Also, it would be nice to make DESCRIBE FOO tell whether a symbol
;;; has a setf expansion and/or a setf function defined.
(defknown (bit-and bit-ior bit-xor bit-eqv bit-nand bit-nor bit-andc1 bit-andc2
bit-orc1 bit-orc2)
- ((array bit) (array bit) &optional (or (array bit) (member t)))
+ ((array bit) (array bit) &optional (or (array bit) (member t nil)))
(array bit)
(foldable)
#|:derive-type #'result-type-last-arg|#)
-(defknown bit-not ((array bit) &optional (or (array bit) (member t)))
+(defknown bit-not ((array bit) &optional (or (array bit) (member t nil)))
(array bit)
(foldable)
#|:derive-type #'result-type-last-arg|#)
(defknown %put (symbol t t) t (unsafe))
(defknown %setelt (sequence index t) t (unsafe))
(defknown %svset (simple-vector index t) t (unsafe))
-(defknown %bitset (bit-vector &rest index) bit (unsafe))
-(defknown %sbitset (simple-bit-vector &rest index) bit (unsafe))
+(defknown %bitset ((array bit) &rest index) bit (unsafe))
+(defknown %sbitset ((simple-array bit) &rest index) bit (unsafe))
(defknown %charset (string index character) character (unsafe))
(defknown %scharset (simple-string index character) character (unsafe))
(defknown %set-symbol-value (symbol t) t (unsafe))
(assert (array-in-bounds-p a 7))
(assert (not (array-in-bounds-p a 11)))
(assert (not (array-in-bounds-p a (1+ most-positive-fixnum)))))
+
+;;; arrays of bits should work:
+(let ((a (make-array '(10 10) :element-type 'bit :adjustable t)))
+ (setf (bit a 0 0) 1)
+ (assert (= (bit a 0 0) 1)))
+(let ((a (make-array '(10 10) :element-type 'bit)))
+ (setf (sbit a 0 0) 1)
+ (assert (= (sbit a 0 0) 1)))
+
+(let ((x (copy-seq #*0011))
+ (y (copy-seq #*0101)))
+ (assert (equalp (bit-and x y nil) #*0001)))
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.12.5"
+"0.7.12.6"