[plt-scheme] Re: call/cc vs let/cc at top level - A BUG?

From: Kyle Smith (airfoil at bellsouth.net)
Date: Mon Jan 1 15:06:07 EST 2007

Robby Findler <robby.findler at ...> writes:

> I think you intended for the first and last examples to be the same --
> is that right? If so, there is a missing parenthesis at the end of the
> let/cc line in the first example (or an extra one in the call/cc
> example, I suppose). In any case those two aren't supposed to behave
> the same -- in the call/cc example, the printf's are captured in the
> continuation, but in the let/cc example, they aren't. Or is there
> something else going on here I'm missing?
No you're not missing a thing; obviously I was.  Thanks for the correction.  
When I add the missing parenthesis to the let/cc example both code fragements 
behave the same.

I also think I have an idea as to why, when the code is placed inside 
anything, including a let clause, that it just repeats the first value over 
and over.  After trying the code on several implementations of Scheme, I 
believe it has something to do with whether there are prompts delimiting the 
REPL at top-level.  This would explain why MIT Scheme, which doesn't have 
prompts implemented repeats the first value even at top-level, and why Petite-
Chez shows similar behavior to DrScheme.  It would also explain why, in the 
first post, I showed that the behavior was consistently correct no matter 
where the code was located if you implemented it with DrScheme's prompt 
primitives instead of call/cc.  That is with call-with-composable-continuation 
used to capture the continuation instead of call/cc.

Many thanks Robby, and a happy new year!

airfoil at bellsouth do com

Posted on the users mailing list.