105:
(DESCRIBE 'STREAM-READ-BYTE)
+106:
+ (reported by Eric Marsden on cmucl-imp 2001-06-15)
+ Executing
+ (TYPEP 0 '(COMPLEX (EQL 0)))
+ signals an error in sbcl-0.6.12.34,
+ The component type for COMPLEX is not numeric: (EQL 0)
+ This is funny since sbcl-0.6.12.34 knows
+ (SUBTYPEP '(EQL 0) 'NUMBER) => T
+
+
+
KNOWN BUGS RELATED TO THE IR1 INTERPRETER
(Note: At some point, the pure interpreter (actually a semi-pure
(:charpos
(fd-stream-char-pos fd-stream))
(:file-length
+ (unless (fd-stream-file fd-stream)
+ ;; This is a TYPE-ERROR because ANSI's species FILE-LENGTH
+ ;; "should signal an error of type TYPE-ERROR if stream is not
+ ;; a stream associated with a file". Too bad there's no very
+ ;; appropriate value for the EXPECTED-TYPE slot..
+ (error 'simple-type-error
+ :datum fd-stream
+ :expected-type 'file-stream
+ :format-control "~S is not a stream associated with a file."
+ :format-arguments (list fd-stream)))
(multiple-value-bind (okay dev ino mode nlink uid gid rdev size
atime mtime ctime blksize blocks)
(sb!unix:unix-fstat (fd-stream-fd fd-stream))
(defun float-radix (x)
#!+sb-doc
- "Returns (as an integer) the radix b of its floating-point
- argument."
- (declare (type float x) (ignore x))
+ "Return (as an integer) the radix b of its floating-point argument."
+ (declare (type float x))
+ ;; ANSI says this function "should signal an error if [..] argument
+ ;; is not a float". Since X is otherwise ignored, Python doesn't
+ ;; check the type by default, so we have to do it ourself:
+ (unless (floatp x)
+ (error 'type-error :datum x :expected-type 'float))
2)
\f
;;;; INTEGER-DECODE-FLOAT and DECODE-FLOAT
(slots (dd-slots dd) (cdr slots)))
((or (null slots)
(and (not *print-readably*)
+ *print-length*
(>= index *print-length*)))
(if (null slots)
(write-string ")" stream)
(write-string string stream))
(dotimes (i minpad)
(write-char padchar stream))
- (do ((chars (+ (length string) minpad) (+ chars colinc)))
- ((>= chars mincol))
- (dotimes (i colinc)
- (write-char padchar stream)))
+ ;; As of sbcl-0.6.12.34, we could end up here when someone tries to
+ ;; print e.g. (FORMAT T "~F" "NOTFLOAT"), in which case ANSI says
+ ;; we're supposed to soldier on bravely, and so we have to deal with
+ ;; the unsupplied-MINCOL-and-COLINC case without blowing up.
+ (when (and mincol colinc)
+ (do ((chars (+ (length string) minpad) (+ chars colinc)))
+ ((>= chars mincol))
+ (dotimes (i colinc)
+ (write-char padchar stream))))
(when padleft
(write-string string stream)))
(search "tests/filesys.pure.lisp"
(namestring pathname)))
dir)))
+
+;;; ANSI: FILE-LENGTH should signal an error of type TYPE-ERROR if
+;;; stream is not a stream associated with a file.
+;;;
+;;; (Peter Van Eynde's ansi-test suite caught this, and Eric Marsden
+;;; reported a fix for CMU CL, which was ported to sbcl-0.6.12.35.)
+(assert (subtypep (nth-value 1 (ignore-errors (file-length *terminal-io*)))
+ 'type-error))
(assert (>= 100 -ifni))
(assert (not (<= 6/7 (* 3 -ifni))))
(assert (not (> +ifni +ifni)))))
+
+;;; ANSI: FILE-LENGTH should signal an error of type TYPE-ERROR if
+;;; stream is not a stream associated with a file.
+;;;
+;;; (Peter Van Eynde's ansi-test suite caught this, and Eric Marsden
+;;; reported a fix for CMU CL, which was ported to sbcl-0.6.12.35.)
+(assert (subtypep (nth-value 1 (ignore-errors (float-radix "notfloat")))
+ 'type-error))
\ No newline at end of file
long-float-positive-infinity long-float-negative-infinity))
(assert-output x))
+;;; Eric Marsden reported that this would blow up in CMU CL (even
+;;; though ANSI says that the mismatch between ~F expected type and
+;;; provided string type is supposed to be handled without signalling
+;;; an error) and provided a fix which was ported to sbcl-0.6.12.35.
+(assert (null (format t "~F" "foo")))
+
;;; success
(quit :unix-status 104)
;;; versions, and a string like "0.6.5.12" is used for versions which
;;; aren't released but correspond only to CVS tags or snapshots.
-"0.6.12.34"
+"0.6.12.35"