[fluxus] and you, apply?

Artem Baguinski femistofel at gmail.com
Sun Feb 12 05:56:41 PST 2006


hi

basicly the same problem as with "load": how do i get the original  
scheme's "apply" back?

i'm currently doing "primitive-load" instead of "load". i could  
accept that loading behaviour is conceptual decision and all.

i can rewrite the other bit with "apply-to-args" but feels bad. are  
you may be using some sort of namespaces / modules / whatever it is  
called in guile to separate fluxus names from scheme names?

to make this more constructive here is what i do:

;; fluxus.scm
(save-name "/Users/artm/fluxus.scm")

; load is redefined in fluxus
(primitive-load "/Users/artm/hyper-cube.scm")

(clear-colour (vector 1 1 1))
(desiredfps 15)

(clear)

(translate (vector -0.5 -0.5 -0.5))

(for-each (lambda (l)
         (push)
         (colour (vadd (vmul l 0.4) #(0.1 0.6 0.4)))
         (translate (vmul l 1.5))
         (build-cube)
         (pop))
     (hyper-cube-v 3))

;; the end

;; hyper-cube.scm
(define (hyper-cube n)
   (cond ((= n 0) '(()))
	(else (append
	       (map (lambda (l) (cons 1 l))
		    (hyper-cube (- n 1)))
	       (map (lambda (l) (cons 0 l))
		    (hyper-cube (- n 1)))))))

(define (hyper-cube-v n)
   (map (lambda (l)
          ; apply is redefined in fluxus
	 ; (apply vector l))
	 (apply-to-args l vector))
        (hyper-cube n)))

cheers,
artm





More information about the Fluxus mailing list