(/show "starting pcl/macros.lisp")
(declaim (declaration
- ;; These three nonstandard declarations seem to be used
- ;; privately within PCL itself to pass information around,
- ;; so we can't just delete them.
- %class
+ ;; As of sbcl-0.7.0.6, SBCL actively uses this declaration
+ ;; to propagate information needed to set up nice debug
+ ;; names (as seen e.g. in BACKTRACE) for method functions.
%method-name
+ ;; These nonstandard declarations seem to be used privately
+ ;; within PCL itself to pass information around, so we can't
+ ;; just delete them.
+ %class
%method-lambda-list
;; This declaration may also be used within PCL to pass
;; information around, I'm not sure. -- WHN 2000-12-30
(/show "done with DECLAIM DECLARATION")
-;;; FIXME: This looks like SBCL's PARSE-BODY, and should be shared.
-(eval-when (:compile-toplevel :load-toplevel :execute)
-
-(defun extract-declarations (body &optional environment)
- ;;(declare (values documentation declarations body))
- (let (documentation
- declarations
- form)
- (when (and (stringp (car body))
- (cdr body))
- (setq documentation (pop body)))
- (block outer
- (loop
- (when (null body) (return-from outer nil))
- (setq form (car body))
- (when (block inner
- (loop (cond ((not (listp form))
- (return-from outer nil))
- ((eq (car form) 'declare)
- (return-from inner t))
- (t
- (multiple-value-bind (newform macrop)
- (macroexpand-1 form environment)
- (if (or (not (eq newform form)) macrop)
- (setq form newform)
- (return-from outer nil)))))))
- (pop body)
- (dolist (declaration (cdr form))
- (push declaration declarations)))))
- (values documentation
- (and declarations `((declare ,.(nreverse declarations))))
- body)))
-) ; EVAL-WHEN
-
-(/show "done with EVAL-WHEN (..) DEFUN EXTRACT-DECLARATIONS")
-
(defun get-declaration (name declarations &optional default)
(dolist (d declarations default)
(dolist (form (cdr d))
(/show "pcl/macros.lisp 85")
-(defmacro doplist ((key val) plist &body body &environment env)
- (multiple-value-bind (doc decls bod)
- (extract-declarations body env)
- (declare (ignore doc))
- `(let ((.plist-tail. ,plist) ,key ,val)
- ,@decls
- (loop (when (null .plist-tail.) (return nil))
- (setq ,key (pop .plist-tail.))
- (when (null .plist-tail.)
- (error "malformed plist, odd number of elements"))
- (setq ,val (pop .plist-tail.))
- (progn ,@bod)))))
+(defmacro doplist ((key val) plist &body body)
+ `(let ((.plist-tail. ,plist) ,key ,val)
+ (loop (when (null .plist-tail.) (return nil))
+ (setq ,key (pop .plist-tail.))
+ (when (null .plist-tail.)
+ (error "malformed plist, odd number of elements"))
+ (setq ,val (pop .plist-tail.))
+ (progn ,@body))))
(/show "pcl/macros.lisp 101")
(when (and new-value (class-wrapper new-value))
(setf (find-class-cell-predicate cell)
(fdefinition (class-predicate-name new-value))))
- (when (and new-value (not (forward-referenced-class-p new-value)))
-
- (dolist (keys+aok (find-class-cell-make-instance-function-keys
- cell))
- (update-initialize-info-internal
- (initialize-info new-value (car keys+aok) nil (cdr keys+aok))
- 'make-instance-function))))
+ (update-ctors 'setf-find-class :class new-value :name symbol))
new-value)
(error "~S is not a legal class name." symbol)))
`(setf ,name))
(defsetf slot-value set-slot-value)
-
+\f
(/show "finished with pcl/macros.lisp")