#40: Non-constant function-argument initforms ------------------------+--------------------------------------------------- Reporter: ehuelsmann | Owner: ehuelsmann Type: defect | Status: new Priority: major | Milestone: Component: compiler | Version: Keywords: | ------------------------+--------------------------------------------------- The compiler doesn't support non-constant initforms for compiled functions. One way to work around this would be to take advantage of the existing processArgs() functionality in Closure.java. It's used by the interpreter to evaluate non-constant initforms.
In order to re-use the functionality, the compiler would need to create an Environment object and set it up with the variables used in the initforms for the interpreter to access.
This can be done by removing the CompiledClosure wrapper around ClosureTemplateFunction. The ClosureTemplateFunction should support being .execute()-ed directly (instead of through the wrapper). The compiler should then set a context record (array of LispObjects) currently carried around in CompiledClosure directly in ClosureTemplateFunction. The Environment object should be used to set the 'environment' field in ClosureTemplateFunction.