I added tail call optimization now.
it is a bit messy, but as far as I can tell it is working.
I am using *** olines, my teqnique is:
in the context info I have a few fields that can be used to pass a function
and args to a higher level applys.
each apply exists as a loop which continuously applies a function to
arguments until there is no longer a function (none was put into tail
position by the last call...).
an "apply level" is used to note how many levels of apply there are, if this
is >0 when apply is called then the function and args are put in the tail
slot and the apply returns (which returns through the last forms into the
apply that called them).
I have to save/restore the apply level when entering/exiting frames,
otherwise the tail call mecanism doesn't work right...
as for continuations:
these may be more work. I may need to copy the stack (eg: by setting an
"entry mark" on the effective "top of stack" and copying until the current
end of the stack).
this may pose problems with threads, a fix may be to adjust the versions of
"ebp" in the stack if loading to a different address, but there may be yet
other problems lurking with this (eg: if one calls through a more normal c
function there is risk of it's pointers being messed up or such in some
I have little idea of the relative speed at present between my compiled and
interpreted code though, but I figure the compiled code is probably