not cause a type error;
** CONSTANTP now returns true for all self-evaluating objects.
+changes in sbcl-0.7.13 relative to sbcl-0.7.12:
+ * fixed some bugs revealed by Paul Dietz' test suite:
+ ** ARRAY-IN-BOUNDS-P now allows arbitrary integers as arguments,
+ not just nonnegative fixnums;
+
planned incompatible changes in 0.7.x:
* (not done yet, but planned:) When the profiling interface settles
down, maybe in 0.7.x, maybe later, it might impact TRACE. They both
(declare (list subs) (fixnum axis chunk-size result))
(let ((index (car subs))
(dim (%array-dimension array axis)))
- (declare (fixnum index dim))
+ (declare (fixnum dim))
(unless (< -1 index dim)
(if invalid-index-error-p
(error 'simple-type-error
:datum index
:expected-type `(integer 0 (,dim)))
(return-from %array-row-major-index nil)))
- (incf result (* chunk-size index))
+ (incf result (* chunk-size (the fixnum index)))
(setf chunk-size (* chunk-size dim))))
(let ((index (first subscripts))
(length (length (the (simple-array * (*)) array))))
(defknown array-rank (array) array-rank (foldable flushable))
(defknown array-dimension (array array-rank) index (foldable flushable))
(defknown array-dimensions (array) list (foldable flushable))
-(defknown array-in-bounds-p (array &rest index) boolean (foldable flushable))
+(defknown array-in-bounds-p (array &rest integer) boolean (foldable flushable))
(defknown array-row-major-index (array &rest index) array-total-size
(foldable flushable))
(defknown array-total-size (array) array-total-size (foldable flushable))
:element-type 'character
:initial-contents "abcdefghij")))
(assert (string= (reverse a) "edcba")))
+
+;;; ARRAY-IN-BOUNDS-P should work when given non-INDEXes as its
+;;; subscripts (and return NIL, of course)
+(let ((a (make-array 10 :fill-pointer 5)))
+ (assert (not (array-in-bounds-p a -1)))
+ (assert (array-in-bounds-p a 3))
+ (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)))))
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.12.1"
+"0.7.12.2"