Since this is a reasonable user error, it shouldn't be reported as
an SBCL bug.
-169:
- (reported by Alexey Dejneka on sbcl-devel 2002-05-12)
- * (defun test (n)
- (let ((*x* n))
- (declare (special *x*))
- (getx)))
- ; in: LAMBDA NIL
- ; (LET ((*X* N))
- ; (DECLARE (SPECIAL *X*))
- ; (GETX))
- ;
- ; caught STYLE-WARNING:
- ; using the lexical binding of the symbol *X*, not the
- ; dynamic binding, even though the symbol name follows the usual naming
- ; convention (names like *FOO*) for special variables
- ; compilation unit finished
- ; caught 1 STYLE-WARNING condition
- But the code works as it should. Checked in 0.6.12.43 and later.
-
171:
(reported by Pierre Mai while investigating bug 47):
(DEFCLASS FOO () ((A :SILLY T)))
changes in sbcl-0.7.5 relative to sbcl-0.7.4:
* bug 140 fixed: redefinition of classes with different supertypes
is now reflected in the type hierarchy. (thanks to Pierre Mai)
+ * bug 169 fixed: no more bogus warnings about using lexical bindings
+ despite the presence of perfectly good SPECIAL declarations. (thanks
+ to David Lichteblau)
+ * bug fix: Structure type predicate functions now check their argument
+ count as they should.
* minor incompatible change: The LOAD function no longer, when given
a wild pathname to load, loads all files matching that pathname;
instead, an error of type FILE-ERROR is signalled.
:where-from (leaf-where-from specvar)
:specvar specvar)))
(t
- (note-lexical-binding name)
(make-lambda-var :%source-name name)))))
;;; Make the default keyword for a &KEY arg, checking that the keyword
(list x)))))
(assert (null value))
(assert (typep error 'error)))
+
+;;; bug 169 (reported by Alexey Dejneka 2002-05-12, fixed by David
+;;; Lichteblau 2002-05-21)
+(progn
+ (multiple-value-bind (fun warnings-p failure-p)
+ (compile nil
+ ;; Compiling this code should cause a STYLE-WARNING
+ ;; about *X* looking like a special variable but not
+ ;; being one.
+ '(lambda (n)
+ (let ((*x* n))
+ (funcall (symbol-function 'x-getter))
+ (print *x*))))
+ (assert (functionp fun))
+ (assert warnings-p)
+ (assert (not failure-p)))
+ (multiple-value-bind (fun warnings-p failure-p)
+ (compile nil
+ ;; Compiling this code should not cause a warning
+ ;; (because the DECLARE turns *X* into a special
+ ;; variable as its name suggests it should be).
+ '(lambda (n)
+ (let ((*x* n))
+ (declare (special *x*))
+ (funcall (symbol-function 'x-getter))
+ (print *x*))))
+ (assert (functionp fun))
+ (assert (not warnings-p))
+ (assert (not failure-p))))
;;; for internal versions, especially for internal versions off the
;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.4.5"
+"0.7.4.6"