0.7.8.36:
authorAlexey Dejneka <adejneka@comail.ru>
Mon, 14 Oct 2002 06:59:19 +0000 (06:59 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Mon, 14 Oct 2002 06:59:19 +0000 (06:59 +0000)
        * :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.

NEWS
package-data-list.lisp-expr
src/code/deftypes-for-target.lisp
src/code/package.lisp
src/code/seq.lisp
src/compiler/fndb.lisp
src/compiler/ir1opt.lisp
src/compiler/knownfun.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index f278677..6c65e6a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1317,11 +1317,15 @@ changes in sbcl-0.7.9 relative to sbcl-0.7.8:
     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
index 87f9323..ff61204 100644 (file)
@@ -1176,6 +1176,7 @@ is a good idea, but see SB-SYS re. blurring of boundaries."
              "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"
index c153a2e..ddfe5fb 100644 (file)
 ;;; 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
index e71f345..e376b9d 100644 (file)
   "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)
index 9269296..8d09e37 100644 (file)
                              `(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
index 002b9c3..dbdc0a5 100644 (file)
 (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 ())
index 3287929..2dcfc4d 100644 (file)
                           (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))
index 78433e0..54d71e4 100644 (file)
   ;; 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
index 0ec4ea7..5e0b755 100644 (file)
@@ -18,4 +18,4 @@
 ;;; 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"