Update of /project/movitz/cvsroot/movitz/losp/muerte In directory common-lisp.net:/tmp/cvs-serv3927
Modified Files: eval.lisp Log Message: Added parse-docstring-declarations-and-body, and made the parsing of lambda-forms use it, so that e.g.
(lambda (..) "docstring" (declare ..) ..)
should now work in eval.
Date: Fri Oct 22 14:31:34 2004 Author: ffjeld
Index: movitz/losp/muerte/eval.lisp diff -u movitz/losp/muerte/eval.lisp:1.12 movitz/losp/muerte/eval.lisp:1.13 --- movitz/losp/muerte/eval.lisp:1.12 Thu Oct 21 22:45:48 2004 +++ movitz/losp/muerte/eval.lisp Fri Oct 22 14:31:34 2004 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld frodef@acm.org ;;;; Created at: Fri Oct 19 21:15:12 2001 ;;;; -;;;; $Id: eval.lisp,v 1.12 2004/10/21 20:45:48 ffjeld Exp $ +;;;; $Id: eval.lisp,v 1.13 2004/10/22 12:31:34 ffjeld Exp $ ;;;; ;;;;------------------------------------------------------------------
@@ -152,6 +152,16 @@ (dolist (d (cdar p)) (push d declarations))))
+(defun parse-docstring-declarations-and-body (forms) + "From the list of FORMS, return first the list of non-declaration forms, ~ +second the list of declaration-specifiers, third any docstring." + (if (or (not (cdr forms)) + (not (stringp (car forms)))) + (parse-declarations-and-body forms) + (multiple-value-call #'values + (parse-declarations-and-body (cdr forms)) + (car forms)))) + (defun declared-special-p (var declarations) (dolist (d declarations nil) (when (and (consp d) @@ -315,7 +325,7 @@ (symbol-function (lookup-setf-function (second function-name)))) ((lambda) (let ((lambda-list (cadr function-name)) - (lambda-body (cddr function-name))) + (lambda-body (parse-docstring-declarations-and-body (cddr function-name)))) (install-funobj-name :anonymous-lambda (lambda (&rest args) (declare (dynamic-extent args))