[movitz-cvs] CVS movitz/losp/muerte

ffjeld ffjeld at common-lisp.net
Sat Apr 12 16:47:25 UTC 2008


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory clnet:/tmp/cvs-serv3986

Modified Files:
	los-closette.lisp 
Log Message:
Allow :method options to defgeneric.


--- /project/movitz/cvsroot/movitz/losp/muerte/los-closette.lisp	2008/03/15 20:57:57	1.38
+++ /project/movitz/cvsroot/movitz/losp/muerte/los-closette.lisp	2008/04/12 16:47:21	1.39
@@ -10,7 +10,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Created at:    Tue Jul 23 14:29:10 2002
 ;;;;                
-;;;; $Id: los-closette.lisp,v 1.38 2008/03/15 20:57:57 ffjeld Exp $
+;;;; $Id: los-closette.lisp,v 1.39 2008/04/12 16:47:21 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -32,10 +32,15 @@
 		     ,@(canonicalize-defclass-options options env name)))))
 
 (defmacro defgeneric (function-name lambda-list &rest options)
-  `(eval-when (:compile-toplevel)
-     (movitz-ensure-generic-function ',function-name 
-				  :lambda-list ',lambda-list
-				  ,@(canonicalize-defgeneric-options options))))
+  `(progn
+     (eval-when (:compile-toplevel)
+       (movitz-ensure-generic-function ',function-name 
+				       :lambda-list ',lambda-list
+				       ,@(canonicalize-defgeneric-options options)))
+     ,@(mapcan (lambda (option)
+		 (when (eq :method (car option))
+		   (list `(defmethod ,function-name ,@(cdr option)))))
+	       options)))
 
 (defmacro defmethod (&rest args &environment env)
   (multiple-value-bind (name qualifiers lambda-list specializers body declarations documentation)




More information about the Movitz-cvs mailing list