From f30b38bc0af13e17b2745890e583c42041bee2e3 Mon Sep 17 00:00:00 2001 From: jsancho Date: Mon, 2 Nov 2009 18:46:09 +0000 Subject: [PATCH] --- gacela_mobs.lisp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gacela_mobs.lisp b/gacela_mobs.lisp index 0cd56ae..d6d420b 100755 --- a/gacela_mobs.lisp +++ b/gacela_mobs.lisp @@ -19,16 +19,13 @@ ;(in-package :gacela) -(defmacro makemob (name variables &rest methods) - `(let ,variables - (defun ,name (&rest args &aux (option (car args))) - ,(mob-options methods)))) - -(defun mob-options (methods) - (labels ((options (m &aux (option (car m)) (vars (cadr m)) (body (caddr m))) - (cond ((null m) nil) - (t (cons option (cons (lambda body (options (cdddr m)))))))) - (cons 'case (cons 'option (options methods))))) +(defmacro makemob (name &rest methods) + `(defun ,name (&rest args &aux (option (car args))) + ,(cond (methods + (labels ((options (m &aux (option (car m)) (body (cadr m))) + (cond ((null m) nil) + (t (cons (list option `(apply ,body (cdr args))) (options (cddr m))))))) + (cons 'case (cons 'option (options methods)))))))) (defmacro defmob (name variables &key init logic render) `(let ((make-name ',(intern (concatenate 'string "MAKE-" (string name))))) -- 2.39.5