package: FOO-SLOT". (This is fairly bad code, but still it's hard
to see that it should cause symbols to be interned in the CL package.)
+209: "DOCUMENTATION generic function has wrong argument precedence order"
+ The method from
+ (DEFMETHOD DOCUMENTATION ((X (EQL '+)) Y) "WRONG!")
+ should not be executed in the call
+ (DOCUMENTATION '+ 'FUNCTION),
+ as the DOCUMENTATION generic function has a different argument
+ precedence order (see its entry in the CLHS). However, despite a
+ correct generic function definition in the PCL source code, SBCL
+ returns "WRONG!" for the call.
+
DEFUNCT CATEGORIES OF BUGS
IR1-#:
These labels were used for bugs related to the old IR1 interpreter.
(when restp
`(&rest ,(intern "Discriminating Function &rest Arg")))))
\f
+(defmethod generic-function-argument-precedence-order
+ ((gf standard-generic-function))
+ (aver (eq *boot-state* 'complete))
+ (loop with arg-info = (gf-arg-info gf)
+ with lambda-list = (arg-info-lambda-list arg-info)
+ for argument-position in (arg-info-precedence arg-info)
+ collect (nth argument-position lambda-list)))
+
(defmethod generic-function-lambda-list ((gf generic-function))
(gf-lambda-list gf))
--- /dev/null
+;;;; miscellaneous side-effectful tests of the MOP
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; While most of SBCL is derived from the CMU CL system, the test
+;;;; files (like this one) were written from scratch after the fork
+;;;; from CMU CL.
+;;;;
+;;;; This software is in the public domain and is provided with
+;;;; absolutely no warranty. See the COPYING and CREDITS files for
+;;;; more information.
+
+;;;; Note that the MOP is not in a supported state. Package issues
+;;;; (both MOP/SB-PCL and CL/SB-PCL) have yet to be resolved, and
+;;;; there is likely to be missing functionality. However, this seems
+;;;; a good a way as any of ensuring that we have no regressions.
+
+(defpackage "MOP-TEST"
+ ;; eventually, we might want "MOP" as well here.
+ (:use "CL"))
+
+(in-package "MOP-TEST")
+
+(defgeneric fn-with-odd-arg-precedence (a b c)
+ (:argument-precedence-order b c a))
+
+(assert (equal
+ (sb-pcl:generic-function-lambda-list #'fn-with-odd-arg-precedence)
+ '(a b c)))
+(assert (equal
+ (sb-pcl:generic-function-argument-precedence-order #'fn-with-odd-arg-precedence)
+ '(b c a)))
+
+#||
+This is actually a test of vanilla CLOS, not the MOP; however, there isn't
+a terribly easy way of testing this without it (FIXME: one would have to
+construct a series of DOCUMENTATION methods, probably involving
+CALL-NEXT-METHOD). However, since we're actually getting this wrong
+currently, better put in a quick test in the hope that we can fix it soon:
+
+(assert (equal
+ (sb-pcl:generic-function-argument-precedence-order #'documentation)
+ (let ((ll (sb-pcl:generic-function-lambda-list #'documentation)))
+ (list (nth ll 1) (nth ll 0)))))
+||#
+\f
+;;;; success
+(sb-ext:quit :unix-status 104)