|
It's not quite clear to me what you are trying to achieve. The 'environment' you can set refers to global variables only. So all recursive instances of your function (closure) will use the same environment table, and share the same set of global variables, which is what languages that use lexical scope usually do. Your code only creates one environment. Local variables defined inside the function will not be shared. What did you expect to happen? On Nov 4, 2007, at 9:33 PM, Matthew Armstrong wrote: Is it possible to use setfenv recursively? When I call setfenv, it attaches to the function, but it seems like it should more naturally attach to the function's call. -- Gé Weijers |