From 63f5fdcb4b0450ad85cc41e867710304c044ff32 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Wed, 2 Apr 2003 16:08:25 +0000 Subject: [PATCH] 0.pre8.30: Fix the PCL fix, *sigh* ... don't error if we can't find the class at macroexpand time, but emit a diagnostic instead. (caught by McCLIM code) Also enhancement to make-target-contrib.sh ... allow contribs to depend asdfwise on each other ... (side effect: now ASDF-hooked REQUIRE works on fresh-built uninstalled SBCL with the command line: SBCL_HOME=`pwd`/contrib ./src/runtime/sbcl --core output/sbcl.core ) --- make-target-contrib.sh | 7 +++++++ src/pcl/boot.lisp | 17 +++++++++++++++-- tests/clos.impure-cload.lisp | 7 +++++++ version.lisp-expr | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/make-target-contrib.sh b/make-target-contrib.sh index cc67a29..3095bc4 100644 --- a/make-target-contrib.sh +++ b/make-target-contrib.sh @@ -26,6 +26,13 @@ export SBCL SBCL_BUILDING_CONTRIB gnumake=${GNUMAKE:-gmake} +mkdir -p contrib/systems +rm -f contrib/systems/* + +for i in contrib/*/*.asd; do + ln -sf ../../$i contrib/systems/ +done + for i in contrib/*; do test -d $i && test -f $i/Makefile || continue; # export INSTALL_DIR=$SBCL_HOME/`basename $i ` diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index bdb2f18..7e0131d 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -587,13 +587,26 @@ bootstrapping. ;; weirdness when bootstrapping.. -- WHN 20000610 '(ignorable)) (t - ;; Otherwise, we can make Python very happy. + ;; Otherwise, we can usually make Python very happy. (let ((type (info :type :kind specializer))) (ecase type ((:primitive :defined :instance :forthcoming-defclass-type) `(type ,specializer ,parameter)) ((nil) - `(type ,(class-name (find-class specializer)) ,parameter))))))) + (let ((class (find-class specializer nil))) + (if class + `(type ,(class-name class) ,parameter) + (progn + ;; we can get here, and still not have a failure + ;; case, by doing MOP programming like (PROGN + ;; (ENSURE-CLASS 'FOO) (DEFMETHOD BAR ((X FOO)) + ;; ...)). Best to let the user know we haven't + ;; been able to extract enough information: + (style-warn + "~@" + specializer + 'parameter-specializer-declaration-in-defmethod) + '(ignorable)))))))))) (defun make-method-lambda-internal (method-lambda &optional env) (unless (and (consp method-lambda) (eq (car method-lambda) 'lambda)) diff --git a/tests/clos.impure-cload.lisp b/tests/clos.impure-cload.lisp index beaa4ee..db4785a 100644 --- a/tests/clos.impure-cload.lisp +++ b/tests/clos.impure-cload.lisp @@ -62,6 +62,13 @@ (defmethod baz ((x specializer2)) x) (defmethod baz ((x specializer1)) x) (assert (typep (baz (make-instance 'specializer1)) 'specializer1)) + +;;; in a similar vein, we should be able to define methods on classes +;;; that are effectively unknown to the type system: +(sb-mop:ensure-class 'unknown-type) +(defmethod method ((x unknown-type)) x) +;;; (we can't call it without defining methods on allocate-instance +;;; etc., but we should be able to define it). ;;; success (sb-ext:quit :unix-status 104) \ No newline at end of file diff --git a/version.lisp-expr b/version.lisp-expr index 9bc52ce..75de076 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.29" +"0.pre8.30" -- 1.7.10.4