[plt-scheme] tree->generator from t-y-scheme question

From: Joel Reymont (joelr at well.com)
Date: Wed Dec 8 09:30:32 EST 2004


I'm looking at the tree traversal with continuations example in Teach
Yourself Scheme in Fixnum Days. I think I have an almost complete grasp
on it but I'm missing one bit of info.

In generate-leaves:

    (lambda (rest-of-tree) 
        (set! generate-leaves 
            (lambda () 
                (rest-of-tree 'resume))) 
        (caller tree)))))) 

Is it correct to say that rest-of-tree is passed 'resume because
generate-leaves takes no parameters?

What is the rest-of-tree continuation in this scenario, i.e. where's the

    (lambda () 
        (let loop ((tree tree)) 

Are we starting at the "let" here and assigning the remainder of the tree
to tree?

    Thanks, Joel

OpenPoker: The Linux of poker software

Posted on the users mailing list.