From acebf22f0e171abd7a67c866047ba35530343e45 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Fri, 15 Aug 2008 18:55:41 +0200 Subject: [PATCH] Fixed DEFMETHOD arg parsing. Signed-off-by: Stelian Ionescu --- base/pkgdcl.lisp | 4 ++-- base/return-star.lisp | 15 +++++++++++---- io.zeta-streams.asd | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/base/pkgdcl.lisp b/base/pkgdcl.lisp index 1e86200..0af6d4b 100644 --- a/base/pkgdcl.lisp +++ b/base/pkgdcl.lisp @@ -7,9 +7,9 @@ (defpackage :iolib.base (:use #:common-lisp :alexandria) - (:shadow #:defun ;; #:defmethod + (:shadow #:defun #:defmethod #:defmacro #:define-compiler-macro) - (:export #:return* #:defun ;; #:defmethod + (:export #:return* #:defun #:defmethod #:defmacro #:define-compiler-macro)) (flet ((gather-external-symbols (&rest packages) diff --git a/base/return-star.lisp b/base/return-star.lisp index 5568d35..2da6965 100644 --- a/base/return-star.lisp +++ b/base/return-star.lisp @@ -9,10 +9,17 @@ `(,(find-right-symbol :defun :series) ,name ,args ,@(wrap-body-for-return-star body))) -;; must parse defmethod args correctly -;; (cl:defmacro defmethod (name args &body body) -;; `(,(find-right-symbol :defmethod) -;; ,name ,args ,@(wrap-body-for-return-star body))) +(cl:defmacro defmethod (name method-qualifier args &body body) + (cond + ;; no method qualifier, this is actually the lambda-list + ((listp method-qualifier) + (setf body (cons args body) + args method-qualifier) + `(,(find-right-symbol :defmethod) + ,name ,args ,@(wrap-body-for-return-star body))) + (t + `(,(find-right-symbol :defmethod) ,name + ,method-qualifier ,args ,@(wrap-body-for-return-star body))))) (cl:defmacro defmacro (name args &body body) `(,(find-right-symbol :defmacro) diff --git a/io.zeta-streams.asd b/io.zeta-streams.asd index fb5b43f..8a1584c 100644 --- a/io.zeta-streams.asd +++ b/io.zeta-streams.asd @@ -9,7 +9,7 @@ :description "Zeta streams." :maintainer "Stelian Ionescu " :licence "MIT" - :depends-on (:cffi :osicat :io.multiplex :alexandria :bordeaux-threads) + :depends-on (:iolib.base :cffi :osicat :io.multiplex :bordeaux-threads) :pathname (merge-pathnames #p"io.streams/zeta/" *load-truename*) :components ((:file "pkgdcl") -- 2.11.4.GIT