]> git.jsancho.org Git - gacela.git/blobdiff - src/views.scm
Functions for playing with arguments when apply to procedures.
[gacela.git] / src / views.scm
index 32a7c3c30b35eecca5829a461c32f183f906ebfb..c19bf338100064fbf0eda3d5f842f18c2adeeac0 100644 (file)
@@ -42,7 +42,7 @@
            (video:rotate ax ay az)
            (video:translate x y z)
            (video:rotate rx ry rz)
-           (primitive)))
+           (primitive (assoc-ref properties 'args))))
          ((translate)
           (set! x (+ x (car params)))
           (set! y (+ y (cadr params)))
       (mesh 'rotate 0 0 (car params)))
   mesh)
 
+
+;;; Primitives
+
+(define-macro (primitive proc)
+  `(lambda (. params)
+     (let ((m (mesh (lambda (args) (apply ,proc args)))))
+       (m 'property-set! 'args params)
+       m)))
+
 (define-macro (define-primitives . symbols)
   (cond ((null? symbols)
         `#t)