With tail calling, it would certainly be possible. I think the
tradeoff would be accepting that you wouldn't be able to completely
compose a body of code in one shot; somewhere downstream you'd have to
defer a decision like whether to exit the loop or not. That would
probably mean slicing the
If CPS is out - what about passing the loop condition and body into a
function that does the looping for you.
in pseudo code
defn loop_fn(cond, body)
while (cond()) do
body()
end
end
this avoids the need for tail calls entirely - and I presume the whole
lot
On Apr 10, 2010, at 3:01 PM, James Thorpe wrote:
If CPS is out - what about passing the loop condition and body into a
function that does the looping for you.
http://blogs.sun.com/jrose/resource/jsr292/LoopHandle.zip -- John
___
mlvm-dev mailing