[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug with defmethod documentation strings
- To: CommonLoops.PA@Xerox.COM
- Subject: bug with defmethod documentation strings
- From: Gregor.pa@Xerox.COM
- Date: Wed, 23 Mar 88 10:56 PST
- Fcc: BD:>Gregor>mail>outgoing-mail-2.text
- Line-fold: no
- Supersedes: <880323105612.6.GREGOR@SPIFF.parc.xerox.com>
There is a bug in the current version of PCL which affects defmethod's
whose body is just a single string. The bug is apparent in the
following example:
(defmethod type-string ((x symbol)) "a symbol")
(type-string 'foo) ==> NIL instead of "a symbol"
The following patch fixes this bug. Anyone who has run into this
problem should install this patch in their macros.lisp file.
; from macros.lisp
(eval-when (compile load eval)
(defun extract-declarations (body &optional environment)
(declare (ignore environment)
(values documentation declarations body))
(let (documentation declarations form)
(when (and (stringp (car body))
(cdr body))
(setq documentation (pop body)))
(loop
(when (null body) (return))
(setq form (car body))
(cond ((and (listp form) (eq (car form) 'declare))
(dolist (declaration (cdr (pop body)))
(push declaration declarations)))
(t (return))))
(values documentation `((declare ,.declarations)) body)))
)
-------