Ups, something went wrong with my last mail, the explaining text was
chopped off. Ok here its again.

Hi,

I just got functions running in scheme.

It uses a pre-version of Sean O'Rourkes scratchpad.pmc. (Sean, I had to
reimplement some functions to get it compile, did I get them right?)

P31 always holds a scratchpad.pmc with the current environment. When a
function is called it is saved along with all the other used
registers. The environment of the function definition is set to P31,
and extended by one scope. The formal parameters of the function are
stored in this new scope. After the return of the function the old
scope is restored, along with the other old registers.

local variables are just a special form of function creation and
application.

The implementation of the function object is very simple: Its an Array
of 3 Elements: The environment at function definition, a jump target
and a (scheme-)list of the formal parameters. I hope it will be
possible to replace this by a Sub.pmc once it will be capable to store
the environment.

This patch supersedes #17109.
If you apply this patch don't forget to cvs add scratchpad.pmc and
defines.t

bye
juergen


Reply via email to