On Aug 25, 2008, at 3:44 AM, mehdi kamali wrote:
> (map (lambda(x)
>       (map (lambda(y)
>               (set! geometry (make cylinder (center x y 0) (material mat) 
> (radius
> r) (height infinity))))
>               (arith-sequence -4 1 10)))
>       (arith-sequence 5 -1 10))

This won't work.  The geometry is supposed to be a list of objects.   
You are setting it to a single object over and over.  You need to use  
a command to append your new object to the existing geometry list, e.g.

(set! geometry (append geometry (list (make cylinder .........))))

"append" is a standard Scheme function to append two lists.  (Note  
that the second argument must also be a list, not a single object!)

Unfortunately, this is one of the drawbacks of using a dynamically  
typed language like Scheme -- it doesn't immediately detect when you  
use the wrong type for something, and only gives you a cryptic error  
later on when you try to use that variable in a place that is  
expecting a different type.

Steven

_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to