[plt-scheme] continuation in top level begin form

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri Aug 4 16:14:03 EDT 2006

A little bit more: I don' t think the r5rs specifies either behavior  
(if you can point me to a particular part you're thinking of tho, I'd  
be more than happy!), but you can interpret it to say that removing  
the begin should not change the behavior. If you do interpret it that  
way, the debug language is right and the non-debugging one is wrong.

Robby

On Aug 4, 2006, at 2:14 PM, Jacob Matthews wrote:

> I am 100% stunned that you noticed this :)
>
> In fact this discrepancy is known, was deliberately introduced to  
> DrScheme very recently, and is intentional (in a manner of speaking).
>
> Robby and I have been looking into the interaction between top- 
> level begin and continuations, and we concluded that mzscheme did  
> it wrong. Robby fixed the interaction in DrScheme's debugging modes  
> (where it turned out to be easy to fix), but it is not yet fixed  
> for the non-debugging modes.
>
> -jacob
>
> Jos Koot wrote:
>
>> 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.
>>
>>
>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



Posted on the users mailing list.