X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fcompiler-support.lisp;h=fa1a9172a767dcb64325376759bf4e013aa93c21;hb=4ed3f0d08c3a57a6762018d9622f253ab9d0f2b6;hp=b35093cd1516fe5cb16feca8fcb217699bb71c88;hpb=a736ac10b709b2d40305f0a6e3764afd246a8ef5;p=sbcl.git diff --git a/src/pcl/compiler-support.lisp b/src/pcl/compiler-support.lisp index b35093c..fa1a917 100644 --- a/src/pcl/compiler-support.lisp +++ b/src/pcl/compiler-support.lisp @@ -38,7 +38,7 @@ (movable foldable flushable explicit-check)) (deftransform sb-pcl::pcl-instance-p ((object)) - (let* ((otype (continuation-type object)) + (let* ((otype (lvar-type object)) (std-obj (specifier-type 'sb-pcl::std-object))) (cond ;; Flush tests whose result is known at compile time. @@ -51,6 +51,43 @@ (let ((arg-pos (position-if #'listp stuff))) (if arg-pos `(defmethod ,name ,@(subseq stuff 0 arg-pos) - ,(nth-value 2 (sb-pcl::parse-specialized-lambda-list - (elt stuff arg-pos)))) + ,(handler-case + (nth-value 2 (sb-pcl::parse-specialized-lambda-list + (elt stuff arg-pos))) + (error () ""))) `(defmethod ,name "")))) + +(defvar sb-pcl::*internal-pcl-generalized-fun-name-symbols* nil) + +(defmacro define-internal-pcl-function-name-syntax (name &rest rest) + `(progn + (define-function-name-syntax ,name ,@rest) + (pushnew ',name sb-pcl::*internal-pcl-generalized-fun-name-symbols*))) + +(define-internal-pcl-function-name-syntax sb-pcl::class-predicate (list) + (when (cdr list) + (destructuring-bind (name &rest rest) (cdr list) + (when (and (symbolp name) + (null rest)) + (values t name))))) + +(define-internal-pcl-function-name-syntax sb-pcl::slot-accessor (list) + (when (= (length list) 4) + (destructuring-bind (class slot rwb) (cdr list) + (when (and (member rwb '(sb-pcl::reader sb-pcl::writer sb-pcl::boundp)) + (symbolp slot) + (symbolp class)) + (values t slot))))) + +(defun sb-pcl::random-documentation (name type) + (cdr (assoc type (info :random-documentation :stuff name)))) + +(defun sb-pcl::set-random-documentation (name type new-value) + (let ((pair (assoc type (info :random-documentation :stuff name)))) + (if pair + (setf (cdr pair) new-value) + (push (cons type new-value) + (info :random-documentation :stuff name)))) + new-value) + +(defsetf sb-pcl::random-documentation sb-pcl::set-random-documentation)