]> git.jsancho.org Git - gacela.git/blobdiff - gacela_objects.lisp
(no commit message)
[gacela.git] / gacela_objects.lisp
index c3f9ea255ab258d8ab895b8cf1e2e6c6db54a767..af5cf2043859e1ca0e256cdc1970a7c1bac9411c 100755 (executable)
     object))
 
 (defmacro make-object (name attr bhv &body look)
-  `(let ((attr ,(make-object-attributes attr) bhv ,(make-object-behaviour bhv)))
-     (defun ,name (option) ,@look)
-     ))
+  `(let ((attr ,(cond (attr (cons 'list (make-object-attributes attr)))))
+        (bhv ,(cond (bhv (cons 'list (make-object-behaviour bhv))))))
+     (defun ,name (option &rest param)
+       (case option
+            (:get-attr attr)
+            (:set-attr (setq attr @param))
+            (:get-bhv bhv)
+            (:render ,@look)))))
 
 (defun make-object-attributes (attr)
   (cond ((or (null attr) (atom attr)) nil)