[plt-scheme] Lazy evaluation and tail calls

From: James Coglan (jcoglan at googlemail.com)
Date: Sat Jan 17 09:42:02 EST 2009

Hi there,

My apologies if this is the wrong place to be asking this, but I'm new to
Scheme and am not sure where I can get this question answered. If you know a
better place to ask this, please point me in the right direction.

Basically, I'm learning Scheme by implementing it in Ruby while reading
SICP. I've added tail calls and also an optional lazy (normal-order)
evaluation mode, but I can't get the two to play together. I have a
factorial function that runs iteratively in eager mode, but it blows up the
stack in lazy mode.

I was wondering whether it's possible to have tail call optimisation when
using normal order. I don't want to bang my head against the wall trying to
make it happen if it can't be done.

-- 
James Coglan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090117/cc695bc5/attachment.html>

Posted on the users mailing list.