]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela_mobs.scm
(no commit message)
[gacela.git] / src / gacela_mobs.scm
index e0e2edd8ba5f7c718b7b6807a6354a98f2faec9e..ca4d5d37c08d00fb7825fd9ecf9c6559c530eea1 100755 (executable)
         `(show-mob-hash (,mob 'get-mob-id) (lambda () (,mob))))))
 
 (define-macro (hide-mob mob)
-  `(hide-mob-hash ',mob))
+  (cond ((list? mob)
+        `(let ((m ,mob))
+           (hide-mob-hash (m 'get-mob-id) m)))
+       (else
+        `(hide-mob-hash (,mob 'get-mob-id) (lambda () (,mob))))))
+
+(define-macro (kill-me)
+  `(hide-mob-hash mob-id))
 
 (define (run-mobs mobs)
   (for-each
@@ -72,8 +79,8 @@
 (define-macro (define-mob mob-head . body)
   (let ((name (car mob-head)) (attr (cdr mob-head)))
     `(define ,(string->symbol (string-concatenate (list "make-" (symbol->string name))))
-       (lambda ()
-        (lambda-mob ,attr ,@body)))))
+       (lambda* (#:key ,@attr)
+        (lambda-mob () ,@body)))))
 
 (define-macro (lambda-mob attr . body)
   `(let ,(cons '(mob-id (gensym)) attr)