Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Friday, 2 July 2010

Exploring Iteration in Scheme

From what I've read so far this can be difficult, so that is why I turned to a library solution (applying it to Context Free Scheme will likely be  a whole heap more difficult).

   1 ;test-eager.sps
   2 ;exploring iteration in Scheme
   3 
   4 (import (rnrs)
   5         (surfage s42 eager-comprehensions))
   6 
   7 (define vals (list-ec (: i 0 4)
   8      (cons i (* i 90))
   9 ))
  10 
  11 (display vals)
  12 
  13 output >> ((0 . 0) (1 . 90) (2 . 180) (3 . 270))

So this conceptually might the way to have a shape rotate 4 times by 90 degrees?

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2