+
+
+;;; Bricks Factory
+
+(define active-bricks '())
+
+(define* (draw-bricks #:optional (bricks active-bricks))
+ (cond ((not (null? bricks))
+ ((car bricks))
+ (draw-bricks (cdr bricks)))))
+
+(define (show-brick brick)
+ (set! active-bricks (cons brick active-bricks)))
+
+(define-macro (simple-brick brick-code)
+ (let ((name (gensym)))
+ `(begin
+ (define (,name)
+ ,brick-code)
+ (show-brick ,name)
+ ,name)))
+
+
+;;; Primitive bricks
+
+(define (draw-square . args)
+ (simple-brick (apply video:draw-square args)))
+
+
+(module-map (lambda (sym var)
+ (if (not (eq? sym '%module-public-interface))
+ (module-export! (current-module) (list sym))))
+ (current-module))