On Fri, 23 Feb 2007, Uday Khankhoje wrote:
I define a function along with the usual parameter definitions and then go on to defining the geometry of the problem. While defining the geometry, I use the append command to append a sequence of geometric objects, but find that the function I had defined earlier in the code isn't recognised.

If you do
        (define (foo arg1 arg2) ...)
then "foo" is defined at all later points in the file. Probably, you are misdiagnosing the error.

The second problem I had was that, using a "do" loop within this "append" scope doesn't work {compile error}, but the same "do" loop works out side the "set! geometry" scope.

"do" loops work anywhere. Probably you are just misunderstanding the syntax. Personally, I find "map" easier to use than the Scheme "do" syntax. See also the section on "loops in scheme" in:
        http://ab-initio.mit.edu/wiki/index.php/Guile_and_Scheme_links

Steven

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

Reply via email to