From: Javier Sancho Date: Thu, 21 Jun 2012 19:29:08 +0000 (+0200) Subject: Introducing FRP concepts X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=3bd2b76b06df2cae29900e213924b02b46ffcd3e;p=gacela.git Introducing FRP concepts --- diff --git a/src/gacela.scm b/src/gacela.scm index 7e96a80..2b9a19e 100644 --- a/src/gacela.scm +++ b/src/gacela.scm @@ -348,8 +348,8 @@ ((car bricks)) (draw-bricks (cdr bricks))))) -(define (show-brick brick) - (set! active-bricks (cons brick active-bricks))) +(define-macro (show-brick brick-name) + `(set! active-bricks (cons (lambda () (,brick-name)) active-bricks))) (define-macro (simple-brick brick-code) (let ((name (gensym))) @@ -362,8 +362,10 @@ ;;; Primitive bricks -(define (draw-square . args) - (simple-brick (apply video:draw-square args))) +(define-macro (draw-square . args) + `(simple-brick (apply video:draw-square ',args))) + +(re-export video:draw-square) (module-map (lambda (sym var)