[plt-scheme] continuation in top level begin form

From: Jos Koot (jos.koot at telefonica.net)
Date: Fri Aug 4 15:06:24 EDT 2006

Hi,
The results of the following are different for debugging on/off.

(begin
 (define cc (let/cc cc cc))
 (display "once or twice?\n")
 (if (procedure? cc) (cc 'aap) 'end))

Results without debugging.
Welcome to DrScheme, version 352.2-svn3aug2006.
Language: Textual (MzScheme, includes R5RS) custom.
once or twice?
once or twice?
end

Results with debugging:
Welcome to DrScheme, version 352.2-svn3aug2006.
Language: Textual (MzScheme, includes R5RS) custom.
once or twice?

I think R5RS prescribes 'twice', whereas mzscheme's language manual section 
2.8.5 prescribes 'once', assumming the continuation of a top level form 
pointing to the print phase of the read eval print loop.
It does not bother me too much, but I think this discrepancy between 
debugging/no debugging is not intended. (Please, do not remove the lifting 
of the body expressions of begin forms, for that's a good idea, I think)
Best wishes, Jos Koot.





Posted on the users mailing list.