]> git.jsancho.org Git - gacela.git/blobdiff - gacela_objects.lisp
(no commit message)
[gacela.git] / gacela_objects.lisp
index 00ade7fd0d7503419091d7967517692f859ead5c..c3f9ea255ab258d8ab895b8cf1e2e6c6db54a767 100755 (executable)
     active-objects))
 
 
-(defmacro make-object (&key name class attr bhv look)
-  `(let ((object
-         '(:name ,name :class ,class :attr ,(make-object-attributes attr) :bhv ,(make-object-behaviour bhv) :look ,look)))
-     (add-object object)
-     object))
+(defun make-object-old (name &key attr bhv look)
+  (let ((object
+        `(:name ,name :attr ,(make-object-attributes attr) :bhv ,(make-object-behaviour bhv) :look ,look)))
+    (add-object object)
+    object))
+
+(defmacro make-object (name attr bhv &body look)
+  `(let ((attr ,(make-object-attributes attr) bhv ,(make-object-behaviour bhv)))
+     (defun ,name (option) ,@look)
+     ))
 
 (defun make-object-attributes (attr)
   (cond ((or (null attr) (atom attr)) nil)
     `(,pname ,value)))
 
 (defun make-object-behaviour (bhv)
-  (cond ((consp bhv) bhv)
-       (t (list bhv))))
+  (cond ((null bhv) nil)
+       ((atom bhv) (list bhv))
+       (t bhv)))