From: Christophe Rhodes Date: Mon, 1 Mar 2004 20:30:23 +0000 (+0000) Subject: 0.8.8.8: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1d46d379bb7a6424524b978f213ef69be5f1ad69;p=sbcl.git 0.8.8.8: Fix for CLEAR-INPUT ... its optional argument can be NIL or T as well as a stream; ... since we're in the area, s/STREAMLIKE/STREAM-DESIGNATOR/ s/STRINGABLE/STRING-DESIGNATOR/ s/SYMBOLS/SYMBOLS-DESIGNATOR/ (and move SYMBOLS-DESIGNATOR and PACKAGE-DESIGNATOR to deftypes-for-target.lisp where they belong) Note *ZAP-ARRAY-DATA-TEMP* as a source of non-threadsafety in ADJUST-ARRAY --- diff --git a/NEWS b/NEWS index 42d501a..d53b1a0 100644 --- a/NEWS +++ b/NEWS @@ -2326,6 +2326,8 @@ changes in sbcl-0.8.9 relative to sbcl-0.8.8: ** MAKE-STRING-INPUT-STREAM accepts NIL as a value for :END. ** MAKE-STRING-INPUT-STREAM functions correctly for strings with element-type NIL. + ** CLEAR-INPUT accepts NIL and T for its (optional) stream + argument. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/contrib/sb-simple-streams/fndb.lisp b/contrib/sb-simple-streams/fndb.lisp index 6d8579f..2df6088 100644 --- a/contrib/sb-simple-streams/fndb.lisp +++ b/contrib/sb-simple-streams/fndb.lisp @@ -83,7 +83,7 @@ TODO (rudi 2003-05-19): make the above work, make (defknown open) use it. ;; :derive-type #'result-type-open-class ) - (sb-c:defknown listen (&optional sb-kernel:streamlike + (sb-c:defknown listen (&optional sb-kernel:stream-designator (or null (integer 1 10) (member character))) boolean (sb-c::unsafely-flushable sb-c::explicit-check)) diff --git a/doc/internals-notes/threading-specials b/doc/internals-notes/threading-specials index aad7915..aa583b6 100644 --- a/doc/internals-notes/threading-specials +++ b/doc/internals-notes/threading-specials @@ -1044,7 +1044,7 @@ SB-IMPL::*CLOSE-IN-PARENT* SB-IMPL::*IN-COMPILATION-UNIT* SB-IMPL::*CIRCULARITY-HASH-TABLE* SB-IMPL::*LOAD-PRINT-STUFF* -SB-IMPL::*ZAP-ARRAY-DATA-TEMP* +SB-IMPL::*ZAP-ARRAY-DATA-TEMP* ; FIXME: ADJUST-ARRAY non-threadsafe SB-IMPL::*ACTIVE-PROCESSES* SB-IMPL::*SHARP-SHARP-ALIST* SB-IMPL::*BASE-POWER* diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 43ed578..fc518a3 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -1254,6 +1254,7 @@ is a good idea, but see SB-SYS re. blurring of boundaries." "OBJECT-NOT-VECTOR-ERROR" "OBJECT-NOT-WEAK-POINTER-ERROR" "ODD-KEY-ARGS-ERROR" "OUTPUT-OBJECT" "OUTPUT-UGLY-OBJECT" + "PACKAGE-DESIGNATOR" "PACKAGE-DOC-STRING" "PACKAGE-HASHTABLE-SIZE" "PACKAGE-HASHTABLE-FREE" "PACKAGE-INTERNAL-SYMBOLS" "PACKAGE-EXTERNAL-SYMBOLS" @@ -1302,9 +1303,10 @@ is a good idea, but see SB-SYS re. blurring of boundaries." "SINGLE-VALUE-TYPE" "SINGLE-VALUE-SPECIFIER-TYPE" "SPECIALIZABLE" "SPECIALIZABLE-VECTOR" "SPECIFIER-TYPE" "STACK-REF" - "STREAMLIKE" "STRINGABLE" + "STREAM-DESIGNATOR" "STRING-DESIGNATOR" "STRUCTURE-RAW-SLOT-TYPE-AND-SIZE" "SUB-GC" + "SYMBOLS-DESIGNATOR" "%INSTANCE-LENGTH" "%INSTANCE-REF" "%INSTANCE-SET" "SYSTEM-AREA-CLEAR" diff --git a/src/code/deftypes-for-target.lisp b/src/code/deftypes-for-target.lisp index 4e657c9..5005775 100644 --- a/src/code/deftypes-for-target.lisp +++ b/src/code/deftypes-for-target.lisp @@ -129,9 +129,7 @@ ;;; FIXME: could probably go away (sb!xc:deftype form () t) -;;; Maclisp compatibility... -;;; FIXME: should be STRING-DESIGNATOR (the term used in the ANSI spec) -(sb!xc:deftype stringable () '(or string symbol character)) +(sb!xc:deftype string-designator () '(or string symbol character)) ;;; a thing legal in places where we want the name of a file (sb!xc:deftype filename () '(or string pathname)) @@ -142,6 +140,10 @@ (sb!xc:deftype logical-host-designator () '(or host string)) +(sb!xc:deftype package-designator () '(or string-designator sb!xc:package)) +;;; a designator for a list of symbols +(sb!xc:deftype symbols-designator () '(or list symbol)) + ;;; a thing returned by the irrational functions. We assume that they ;;; never compute a rational result. (sb!xc:deftype irrational () @@ -161,10 +163,7 @@ `(or null integer)) ;;; a valid argument to a stream function -;;; -;;; FIXME: should probably be STREAM-DESIGNATOR, after the term -;;; used in the ANSI spec (if this is in fact exactly the same thing) -(sb!xc:deftype streamlike () '(or stream (member nil t))) +(sb!xc:deftype stream-designator () '(or stream (member nil t))) ;;; an object suitable for input to standard functions that accept ;;; "environment objects" (of the ANSI glossary) diff --git a/src/code/stream.lisp b/src/code/stream.lisp index 73844a0..43a7fce 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -465,7 +465,7 @@ (defun %write-string (string stream start end) (declare (type string string)) - (declare (type streamlike stream)) + (declare (type stream-designator stream)) (declare (type index start end)) (let ((stream (out-synonym-of stream))) (cond ((ansi-stream-p stream) diff --git a/src/code/string.lisp b/src/code/string.lisp index f5aa2fa..b1fe487 100644 --- a/src/code/string.lisp +++ b/src/code/string.lisp @@ -23,7 +23,7 @@ (t (error 'simple-type-error :datum x - :expected-type 'stringable + :expected-type 'string-designator :format-control "~S cannot be coerced to a string." :format-arguments (list x))))) diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 0d8fc9f..2c653e4 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -185,17 +185,14 @@ ;;;; from the "Packages" chapter: -(sb!xc:deftype package-designator () '(or stringable sb!xc:package)) -(sb!xc:deftype symbols () '(or list symbol)) - (defknown gentemp (&optional string package-designator) symbol) -(defknown make-package (stringable &key - (:use list) - (:nicknames list) - ;; ### extensions... - (:internal-symbols index) - (:external-symbols index)) +(defknown make-package (string-designator &key + (:use list) + (:nicknames list) + ;; ### extensions... + (:internal-symbols index) + (:external-symbols index)) sb!xc:package) (defknown find-package (package-designator) (or sb!xc:package null) (flushable)) @@ -214,15 +211,17 @@ (defknown find-symbol (string &optional package-designator) (values symbol (member :internal :external :inherited nil)) (flushable)) -(defknown (export import) (symbols &optional package-designator) (eql t)) +(defknown (export import) (symbols-designator &optional package-designator) + (eql t)) (defknown unintern (symbol &optional package-designator) boolean) -(defknown unexport (symbols &optional package-designator) (eql t)) -(defknown shadowing-import (symbols &optional package-designator) (eql t)) +(defknown unexport (symbols-designator &optional package-designator) (eql t)) +(defknown shadowing-import (symbols-designator &optional package-designator) + (eql t)) (defknown shadow ((or symbol string list) &optional package-designator) (eql t)) (defknown (use-package unuse-package) ((or list package-designator) &optional package-designator) (eql t)) -(defknown find-all-symbols (stringable) list (flushable)) +(defknown find-all-symbols (string-designator) list (flushable)) ;;;; from the "Numbers" chapter: @@ -420,7 +419,7 @@ (defknown char-int (character) char-code (movable foldable flushable)) (defknown char-name (character) (or simple-string null) (movable foldable flushable)) -(defknown name-char (stringable) (or character null) +(defknown name-char (string-designator) (or character null) (movable foldable flushable)) (defknown code-char (char-code) base-char ;; By suppressing constant folding on CODE-CHAR when the @@ -859,10 +858,8 @@ (defknown char (string index) character (foldable flushable)) (defknown schar (simple-string index) character (foldable flushable)) -(sb!xc:deftype stringable () '(or character string symbol)) - (defknown (string= string-equal) - (stringable stringable &key (:start1 index) (:end1 sequence-end) + (string-designator string-designator &key (:start1 index) (:end1 sequence-end) (:start2 index) (:end2 sequence-end)) boolean (foldable flushable)) @@ -870,7 +867,7 @@ (defknown (string< string> string<= string>= string/= string-lessp string-greaterp string-not-lessp string-not-greaterp string-not-equal) - (stringable stringable &key (:start1 index) (:end1 sequence-end) + (string-designator string-designator &key (:start1 index) (:end1 sequence-end) (:start2 index) (:end2 sequence-end)) (or index null) (foldable flushable)) @@ -880,28 +877,28 @@ simple-string (flushable)) (defknown (string-trim string-left-trim string-right-trim) - (sequence stringable) simple-string (flushable)) + (sequence string-designator) simple-string (flushable)) (defknown (string-upcase string-downcase string-capitalize) - (stringable &key (:start index) (:end sequence-end)) + (string-designator &key (:start index) (:end sequence-end)) simple-string (flushable)) (defknown (nstring-upcase nstring-downcase nstring-capitalize) (string &key (:start index) (:end sequence-end)) string ()) -(defknown string (stringable) string +(defknown string (string-designator) string (flushable explicit-check)) ;;;; internal non-keyword versions of string predicates: (defknown (string<* string>* string<=* string>=* string/=*) - (stringable stringable index sequence-end index sequence-end) + (string-designator string-designator index sequence-end index sequence-end) (or index null) (foldable flushable)) (defknown string=* - (stringable stringable index sequence-end index sequence-end) + (string-designator string-designator index sequence-end index sequence-end) boolean (foldable flushable)) @@ -972,24 +969,24 @@ (values callable boolean) ()) (defknown (pprint-fill pprint-linear) - (streamlike t &optional t t) + (stream-designator t &optional t t) null ()) (defknown pprint-tabular - (streamlike t &optional t t unsigned-byte) + (stream-designator t &optional t t unsigned-byte) null ()) (defknown pprint-indent - ((member :block :current) real &optional streamlike) + ((member :block :current) real &optional stream-designator) null ()) (defknown pprint-newline - ((member :linear :fill :miser :mandatory) &optional streamlike) + ((member :linear :fill :miser :mandatory) &optional stream-designator) null ()) (defknown pprint-tab ((member :line :section :line-relative :section-relative) - unsigned-byte unsigned-byte &optional streamlike) + unsigned-byte unsigned-byte &optional stream-designator) null ()) (defknown set-pprint-dispatch @@ -1000,20 +997,21 @@ ;;; may return any type due to eof-value... (defknown (read read-preserving-whitespace read-char-no-hang read-char) - (&optional streamlike t t t) t (explicit-check)) + (&optional stream-designator t t t) t (explicit-check)) -(defknown read-delimited-list (character &optional streamlike t) list +(defknown read-delimited-list (character &optional stream-designator t) list (explicit-check)) -(defknown read-line (&optional streamlike t t t) (values t boolean) +(defknown read-line (&optional stream-designator t t t) (values t boolean) (explicit-check)) -(defknown unread-char (character &optional streamlike) t +(defknown unread-char (character &optional stream-designator) t (explicit-check)) -(defknown peek-char (&optional (or character (member nil t)) streamlike t t t) +(defknown peek-char (&optional (or character (member nil t)) + stream-designator t t t) t (explicit-check)) -(defknown listen (&optional streamlike) boolean (flushable explicit-check)) +(defknown listen (&optional stream-designator) boolean (flushable explicit-check)) -(defknown clear-input (&optional stream) null (explicit-check)) +(defknown clear-input (&optional stream-designator) null (explicit-check)) (defknown read-from-string (string &optional t t @@ -1034,7 +1032,7 @@ (defknown write (t &key - (:stream streamlike) + (:stream stream-designator) (:escape t) (:radix t) (:base (integer 2 36)) @@ -1054,7 +1052,9 @@ (any explicit-check) :derive-type #'result-type-first-arg) -(defknown (prin1 print princ) (t &optional streamlike) t (any explicit-check) +(defknown (prin1 print princ) (t &optional stream-designator) + t + (any explicit-check) :derive-type #'result-type-first-arg) ;;; xxx-TO-STRING functions are not foldable because they depend on @@ -1070,24 +1070,25 @@ (defknown (prin1-to-string princ-to-string) (t) simple-string (flushable)) -(defknown write-char (character &optional streamlike) character +(defknown write-char (character &optional stream-designator) character (explicit-check)) (defknown (write-string write-line) - (string &optional streamlike &key (:start index) (:end sequence-end)) + (string &optional stream-designator &key (:start index) (:end sequence-end)) string (explicit-check)) (defknown (terpri finish-output force-output clear-output) - (&optional streamlike) null + (&optional stream-designator) null (explicit-check)) -(defknown fresh-line (&optional streamlike) boolean +(defknown fresh-line (&optional stream-designator) boolean (explicit-check)) (defknown write-byte (integer stream) integer (explicit-check)) -(defknown format ((or streamlike string) (or string function) &rest t) +(defknown format ((or (member nil t) stream string) + (or string function) &rest t) (or string null) (explicit-check)) @@ -1289,8 +1290,8 @@ t) (defknown dribble (&optional filename &key (:if-exists t)) (values)) -(defknown apropos (stringable &optional package-designator t) (values)) -(defknown apropos-list (stringable &optional package-designator t) list +(defknown apropos (string-designator &optional package-designator t) (values)) +(defknown apropos-list (string-designator &optional package-designator t) list (flushable)) (defknown get-decoded-time () diff --git a/version.lisp-expr b/version.lisp-expr index 9872d8f..294293c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.8.7" +"0.8.8.8"