+ e. Compiling
+
+ (flet ((foo (&key y) (list y)))
+ (list (foo :y 1 :y 2)))
+
+ issues confusing message
+
+ ; in: LAMBDA NIL
+ ; (FOO :Y 1 :Y 2)
+ ;
+ ; caught STYLE-WARNING:
+ ; The variable #:G15 is defined but never used.
+
+212: "Sequence functions and circular arguments"
+ COERCE, MERGE and CONCATENATE go into an infinite loop when given
+ circular arguments; it would be good for the user if they could be
+ given an error instead (ANSI 17.1.1 allows this behaviour on the part
+ of the implementation, as conforming code cannot give non-proper
+ sequences to these functions. MAP also has this problem (and
+ solution), though arguably the convenience of being able to do
+ (MAP 'LIST '+ FOO '#1=(1 . #1#))
+ might be classed as more important (though signalling an error when
+ all of the arguments are circular is probably desireable).
+
+213: "Sequence functions and type checking"
+ a. MAKE-SEQUENCE, COERCE, MERGE and CONCATENATE cannot deal with
+ various complicated, though recognizeable, CONS types [e.g.
+ (CONS * (CONS * NULL))
+ which according to ANSI should be recognized] (and, in SAFETY 3
+ code, should return a list of LENGTH 2 or signal an error)
+ b. MAP, when given a type argument that is SUBTYPEP LIST, does not
+ check that it will return a sequence of the given type. Fixing
+ it along the same lines as the others (cf. work done around
+ sbcl-0.7.8.45) is possible, but doing so efficiently didn't look
+ entirely straightforward.
+ c. All of these functions will silently accept a type of the form
+ (CONS INTEGER *)
+ whether or not the return value is of this type. This is
+ probably permitted by ANSI (see "Exceptional Situations" under
+ ANSI MAKE-SEQUENCE), but the DERIVE-TYPE mechanism does not
+ know about this escape clause, so code of the form
+ (INTEGERP (CAR (MAKE-SEQUENCE '(CONS INTEGER *) 2)))
+ can erroneously return T.
+
+214:
+ SBCL 0.6.12.43 fails to compile
+
+ (locally
+ (declare (optimize (inhibit-warnings 0) (compilation-speed 2)))
+ (flet ((foo (&key (x :vx x-p)) (list x x-p)))
+ (foo 1 2)))
+
+ or a more simple example:
+
+ (locally
+ (declare (optimize (inhibit-warnings 0) (compilation-speed 2)))
+ (lambda (x) (declare (fixnum x)) (if (< x 0) 0 (1- x))))
+
+215: ":TEST-NOT handling by functions"
+ a. FIND and POSITION currently signal errors when given non-NIL for
+ both their :TEST and (deprecated) :TEST-NOT arguments, but by
+ ANSI 17.2 "the consequences are unspecified", which by ANSI 1.4.2
+ means that the effect is "unpredictable but harmless". It's not
+ clear what that actually means; it may preclude conforming
+ implementations from signalling errors.
+ b. COUNT, REMOVE and the like give priority to a :TEST-NOT argument
+ when conflict occurs. As a quality of implementation issue, it
+ might be preferable to treat :TEST and :TEST-NOT as being in some
+ sense the same &KEY, and effectively take the first test function in
+ the argument list.
+ c. Again, a quality of implementation issue: it would be good to issue a
+ STYLE-WARNING at compile-time for calls with :TEST-NOT, and a
+ WARNING for calls with both :TEST and :TEST-NOT; possibly this
+ latter should be WARNed about at execute-time too.
+
+216: "debugger confused by frames with invalid number of arguments"
+ In sbcl-0.7.8.51, executing e.g. (VECTOR-PUSH-EXTEND T), BACKTRACE, Q
+ leaves the system confused, enough so that (QUIT) no longer works.
+ It's as though the process of working with the uninitialized slot in
+ the bad VECTOR-PUSH-EXTEND frame causes GC problems, though that may
+ not be the actual problem. (CMU CL 18c doesn't have problems with this.)
+
+217: "Bad type operations with FUNCTION types"
+ In sbcl.0.7.7:
+
+ * (values-type-union (specifier-type '(function (base-char)))
+ (specifier-type '(function (integer))))
+
+ #<FUN-TYPE (FUNCTION (BASE-CHAR) *)>
+
+ It causes insertion of wrong type assertions into generated
+ code. E.g.
+
+ (defun foo (x s)
+ (let ((f (etypecase x
+ (character #'write-char)
+ (integer #'write-byte))))
+ (funcall f x s)
+ (etypecase x
+ (character (write-char x s))
+ (integer (write-byte x s)))))
+
+ Then (FOO #\1 *STANDARD-OUTPUT*) signals type error.
+
+ (In 0.7.9.1 the result type is (FUNCTION * *), so Python does not
+ produce invalid code, but type checking is not accurate. Similar
+ problems exist with VALUES-TYPE-INTERSECTION.)
+
+218: "VALUES type specifier semantics"
+ (THE (VALUES ...) ...) in safe code discards extra values.
+
+ (defun test (x y) (the (values integer) (truncate x y)))
+ (test 10 4) => 2
+
+220:
+ Sbcl 0.7.9 fails to compile
+
+ (multiple-value-call #'list
+ (the integer (helper))
+ nil)
+
+ Type check for INTEGER, the result of which serves as the first
+ argument of M-V-C, is inserted after evaluation of NIL. So arguments
+ of M-V-C are pushed in the wrong order. As a temporary workaround
+ type checking was disabled for M-V-Cs in 0.7.9.13. A better solution
+ would be to put the check between evaluation of arguments, but it
+ could be tricky to check result types of PROG1, IF etc.
+
+229:
+ (subtypep 'function '(function)) => nil, t.
+
+233: bugs in constraint propagation
+ a.
+ (defun foo (x)
+ (declare (optimize (speed 2) (safety 3)))
+ (let ((y 0d0))
+ (values
+ (the double-float x)
+ (setq y (+ x 1d0))
+ (setq x 3d0)
+ (quux y (+ y 2d0) (* y 3d0)))))
+ (foo 4) => segmentation violation
+
+ (see usage of CONTINUATION-ASSERTED-TYPE in USE-RESULT-CONSTRAINTS)
+ (see also bug 236)
+
+ b.
+ (declaim (optimize (speed 2) (safety 3)))
+ (defun foo (x y)
+ (if (typep (prog1 x (setq x y)) 'double-float)
+ (+ x 1d0)
+ (+ x 2)))
+ (foo 1d0 5) => segmentation violation
+
+235: "type system and inline expansion"
+ a.
+ (declaim (ftype (function (cons) number) acc))
+ (declaim (inline acc))
+ (defun acc (c)
+ (the number (car c)))
+
+ (defun foo (x y)
+ (values (locally (declare (optimize (safety 0)))
+ (acc x))
+ (locally (declare (optimize (safety 3)))
+ (acc y))))
+
+ (foo '(nil) '(t)) => NIL, T.
+
+ b. (reported by brown on #lisp 2003-01-21)
+
+ (defun find-it (x)
+ (declare (optimize (speed 3) (safety 0)))
+ (declare (notinline mapcar))
+ (let ((z (mapcar #'car x)))
+ (find 'foobar z)))
+
+ Without (DECLARE (NOTINLINE MAPCAR)), Python cannot derive that Z is
+ LIST.
+
+236: "THE semantics is broken"
+
+ (defun foo (a f)
+ (declare (optimize (speed 2) (safety 0)))
+ (+ 1d0
+ (the double-float
+ (multiple-value-prog1
+ (svref a 0)
+ (unless f (return-from foo 0))))))
+
+ (foo #(4) nil) => SEGV
+
+ VOP selection thinks that in unsafe code result type assertions
+ should be valid immediately. (See also bug 233a.)
+
+ The similar problem exists for TRULY-THE.
+
+237: "Environment arguments to type functions"
+ a. Functions SUBTYPEP, TYPEP, UPGRADED-ARRAY-ELEMENT-TYPE, and
+ UPGRADED-COMPLEX-PART-TYPE now have an optional environment
+ argument, but they ignore it completely. This is almost
+ certainly not correct.
+ b. Also, the compiler's optimizers for TYPEP have not been informed
+ about the new argument; consequently, they will not transform
+ calls of the form (TYPEP 1 'INTEGER NIL), even though this is
+ just as optimizeable as (TYPEP 1 'INTEGER).
+
+238: "REPL compiler overenthusiasm for CLOS code"
+ From the REPL,
+ * (defclass foo () ())
+ * (defmethod bar ((x foo) (foo foo)) (call-next-method))
+ causes approximately 100 lines of code deletion notes. Some
+ discussion on this issue happened under the title 'Three "interesting"
+ bugs in PCL', resulting in a fix for this oververbosity from the
+ compiler proper; however, the problem persists in the interactor
+ because the notion of original source is not preserved: for the
+ compiler, the original source of the above expression is (DEFMETHOD
+ BAR ((X FOO) (FOO FOO)) (CALL-NEXT-METHOD)), while by the time the
+ compiler gets its hands on the code needing compilation from the REPL,
+ it has been macroexpanded several times.
+
+ A symptom of the same underlying problem, reported by Tony Martinez:
+ * (handler-case
+ (with-input-from-string (*query-io* " no")
+ (yes-or-no-p))
+ (simple-type-error () 'error))
+ ; in: LAMBDA NIL
+ ; (SB-KERNEL:FLOAT-WAIT)
+ ;
+ ; note: deleting unreachable code
+ ; compilation unit finished
+ ; printed 1 note
+
+241: "DEFCLASS mysteriously remembers uninterned accessor names."
+ (from tonyms on #lisp IRC 2003-02-25)
+ In sbcl-0.7.12.55, typing
+ (defclass foo () ((bar :accessor foo-bar)))
+ (profile foo-bar)
+ (unintern 'foo-bar)
+ (defclass foo () ((bar :accessor foo-bar)))
+ gives the error message
+ "#:FOO-BAR already names an ordinary function or a macro."
+ So it's somehow checking the uninterned old accessor name instead
+ of the new requested accessor name, which seems broken to me (WHN).
+
+242: "WRITE-SEQUENCE suboptimality"
+ (observed from clx performance)
+ In sbcl-0.7.13, WRITE-SEQUENCE of a sequence of type
+ (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*)) on a stream with element-type
+ (UNSIGNED-BYTE 8) will write to the stream one byte at a time,
+ rather than writing the sequence in one go, leading to severe
+ performance degradation.
+
+243: "STYLE-WARNING overenthusiasm for unused variables"
+ (observed from clx compilation)
+ In sbcl-0.7.14, in the presence of the macros
+ (DEFMACRO FOO (X) `(BAR ,X))
+ (DEFMACRO BAR (X) (DECLARE (IGNORABLE X)) 'NIL)
+ somewhat surprising style warnings are emitted for
+ (COMPILE NIL '(LAMBDA (Y) (FOO Y))):
+ ; in: LAMBDA (Y)
+ ; (LAMBDA (Y) (FOO Y))
+ ;
+ ; caught STYLE-WARNING:
+ ; The variable Y is defined but never used.
+
+244: "optimizing away tests for &KEY args of type declared in DEFKNOWN"
+ (caught by clocc-ansi-test :EXCEPSIT-LEGACY-1050)
+ In sbcl-0.pre8.44, (OPEN "foo" :DIRECTION :INPUT :EXTERNAL-FORMAT 'FOO)
+ succeeds with no error (ignoring the bogus :EXTERNAL-FORMAT argument)
+ apparently because the test is optimized away. The problem doesn't
+ exist in sbcl-0.pre8.19. Deleting the (MEMBER :DEFAULT) declaration
+ for :EXTERNAL-FORMAT in DEFKNOWN OPEN (and LOAD) is a workaround for
+ the problem (and should be removed when the problem is fixed).
+
+245: bugs in disassembler
+ a. On X86 an immediate operand for IMUL is printed incorrectly.
+ b. On X86 operand size prefix is not recognized.
+
+246: "NTH-VALUE scaling problem"
+ NTH-VALUE's current implementation for constant integers scales in
+ compile-time as O(n^4), as indeed must the optional dispatch
+ mechanism on which it is implemented. While it is unlikely to
+ matter in real user code, it's still unpleasant to observe that
+ (NTH-VALUE 1000 (VALUES-LIST (MAKE-LIST 1001))) takes several hours
+ to compile.
+
+248: "reporting errors in type specifier syntax"
+ (TYPEP 1 '(SYMBOL NIL)) says something about "unknown type
+ specifier".