* :COUNT argument to sequence functions may be negative.
* DO-SYMBOLS body may contain declarations.
* Reverted patch by CSR in 0.7.8.28: ARRAY-HAS-FILL-POINTER-P
is FLUSHABLE again.
derived types contradict their declared type.
* DEFMACRO is implemented via EVAL-WHEN instead of IR1 translation,
so it can be non-toplevel.
+ * The fasl file version number has changed (because of the new
+ implementation of DEFMACRO).
* fixed bugs 46h and 46i: TWO-WAY- and CONCATENATED-STREAM creation
functions now check the types of their inputs as required by ANSI.
* fixed bug 48c: SYMBOL-MACROLET signals PROGRAM-ERROR when an
introduced symbol is DECLAREd to be SPECIAL.
* fixed reading of (COMPLEX DOUBLE-FLOAT) literals from fasl files
+ * fixed bug: :COUNT argument to sequence functions may be negative
+ * fixed bug: body of DO-SYMBOLS may contain declarations
planned incompatible changes in 0.7.x:
* When the profiling interface settles down, maybe in 0.7.x, maybe
"SCALE-DOUBLE-FLOAT"
#!+long-float "SCALE-LONG-FLOAT"
"SCALE-SINGLE-FLOAT"
+ "SEQUENCE-COUNT"
"SEQUENCE-END" "SEQUENCE-OF-CHECKED-LENGTH-GIVEN-TYPE"
"SET-ARRAY-HEADER" "SET-HEADER-DATA" "SHIFT-TOWARDS-END"
"SHIFT-TOWARDS-START" "SHRINK-VECTOR" "SIGNED-BYTE-32-P"
;;; the :END arg to a sequence
(sb!xc:deftype sequence-end () '(or null index))
+;;; the :COUNT arg to a sequence
+(sb!xc:deftype sequence-count ()
+ `(or null (integer ,(- sb!xc:array-dimension-limit)
+ (,sb!xc:array-dimension-limit))))
+
;;; a valid argument to a stream function
;;;
;;; FIXME: should probably be STREAM-DESIGNATOR, after the term
"DO-SYMBOLS (VAR [PACKAGE [RESULT-FORM]]) {DECLARATION}* {TAG | FORM}*
Executes the FORMs at least once for each symbol accessible in the given
PACKAGE with VAR bound to the current symbol."
- (multiple-value-bind (body decls) body-decls
+ (multiple-value-bind (body decls) (parse-body body-decls nil)
(let ((flet-name (gensym "DO-SYMBOLS-")))
`(block nil
(flet ((,flet-name (,var)
`(integer 0 ,max-end)
;; This seems silly, is there something better?
'(integer (0) 0)))))
+
+(declaim (inline adjust-count)
+ (ftype (function (sequence-count) index) adjust-count))
+(defun adjust-count (count)
+ (cond ((not count) most-positive-fixnum)
+ ((< count 0) 0)
+ (t count)))
+
\f
(defun elt (sequence index)
#!+sb-doc "Return the element of SEQUENCE specified by INDEX."
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(seq-dispatch sequence
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(seq-dispatch sequence
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(seq-dispatch sequence
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(seq-dispatch sequence
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(seq-dispatch sequence
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(seq-dispatch sequence
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (type index length end)
(fixnum count))
(subst-dispatch 'normal)))
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum))
+ (count (adjust-count count))
test-not
old)
(declare (type index length end)
(declare (fixnum start))
(let* ((length (length sequence))
(end (or end length))
- (count (or count most-positive-fixnum))
+ (count (adjust-count count))
test-not
old)
(declare (type index length end)
may be destructively modified. See manual for details."
(declare (fixnum start))
(let ((end (or end (length sequence)))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (fixnum count))
(if (listp sequence)
(if from-end
SEQUENCE may be destructively modified. See manual for details."
(declare (fixnum start))
(let ((end (or end (length sequence)))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (fixnum end count))
(if (listp sequence)
(if from-end
SEQUENCE may be destructively modified. See manual for details."
(declare (fixnum start))
(let ((end (or end (length sequence)))
- (count (or count most-positive-fixnum)))
+ (count (adjust-count count)))
(declare (fixnum end count))
(if (listp sequence)
(if from-end
(defknown remove
(t sequence &key (:from-end t) (:test callable)
(:test-not callable) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
consed-sequence
(flushable call)
:derive-type (sequence-result-nth-arg 2))
(defknown substitute
(t t sequence &key (:from-end t) (:test callable)
(:test-not callable) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
consed-sequence
(flushable call)
:derive-type (sequence-result-nth-arg 3))
(defknown (remove-if remove-if-not)
(callable sequence &key (:from-end t) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
consed-sequence
(flushable call)
:derive-type (sequence-result-nth-arg 2))
(defknown (substitute-if substitute-if-not)
(t callable sequence &key (:from-end t) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
consed-sequence
(flushable call)
:derive-type (sequence-result-nth-arg 3))
(defknown delete
(t sequence &key (:from-end t) (:test callable)
(:test-not callable) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
sequence
(flushable call)
:derive-type (sequence-result-nth-arg 2))
(defknown nsubstitute
(t t sequence &key (:from-end t) (:test callable)
(:test-not callable) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
sequence
(flushable call)
:derive-type (sequence-result-nth-arg 3))
(defknown (delete-if delete-if-not)
(callable sequence &key (:from-end t) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
sequence
(flushable call)
:derive-type (sequence-result-nth-arg 2))
(defknown (nsubstitute-if nsubstitute-if-not)
(t callable sequence &key (:from-end t) (:start index) (:end sequence-end)
- (:count sequence-end) (:key callable))
+ (:count sequence-count) (:key callable))
sequence
(flushable call)
:derive-type (sequence-result-nth-arg 3))
#|:derive-type #'result-type-last-arg|#)
(defknown array-has-fill-pointer-p (array) boolean
- (movable foldable unsafely-flushable))
+ (movable foldable flushable))
(defknown fill-pointer (vector) index (foldable unsafely-flushable))
(defknown vector-push (t vector) (or index null) ())
(defknown vector-push-extend (t vector &optional index) index ())
(if (policy node (= safety 3))
(and (ir1-attributep attr flushable)
(every (lambda (arg)
+ ;; FIXME: when bug 203
+ ;; will be fixed, remove
+ ;; this check
(member (continuation-type-check arg)
'(nil :deleted)))
(basic-combination-args node))
;; may be eliminated if value is unused. The function has no side
;; effects except possibly cons. If a function might signal errors,
;; then it is not flushable even if it is movable, foldable or
- ;; unsafely-flushable. Implies UNSAFELY-FLUSHABLE.
+ ;; unsafely-flushable. Implies UNSAFELY-FLUSHABLE. (In safe code
+ ;; type checking of arguments is always performed by the caller, so
+ ;; a function which SHOULD signal an error if arguments are not of
+ ;; declared types may be FLUSHABLE.)
flushable
;; unsafe call may be eliminated if value is unused. The function
;; has no side effects except possibly cons and signalling an error
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.8.35"
+"0.7.8.36"