[plt-scheme] continuation in top level begin form

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

Hi, Robby Findler , Jacob Matthews
Thanks for your attention to the discrepancy. Once or twice is a choice to 
make, I think. Which choice is to be preferred does not bother me, provided 
it is clearly documented.
r5rs does not say anything about lifting the bodies of begin forms, I think. 
Therefore I tend to think that r5rs points to twice (continuation pointing 
into the begin form, this whole form being the subject of one iteration of 
REPL. Mzscheme language manual is explicit about lifting the body to the top 
level and can be interpreted both ways: either the continuation points to 
the print phase of the LAST REPL or to the print phase of the iteration in 
which the continuation is prepared. The latter means that iterations to 
follow must be included in the continuation. I leave these questions to your 
discretion. I am quite satisfied with your explanation and particularly 
about your answer such as to plan the elimination of the discrepancy in 
future. Best wishes, Jos Koot.

((((lambda(x)((((((x x)x)x)x)x)x))
   (lambda(x)(lambda(y)(x(x y)))))
  (lambda(x)(write x)x))
 "greetings, Jos")
----- Original Message ----- 
From: "Robby Findler" <robby at cs.uchicago.edu>
To: "Jacob Matthews" <jacobm at cs.uchicago.edu>
Cc: "Jos Koot" <jos.koot at telefonica.net>; "PLT-list" 
<plt-scheme at list.cs.brown.edu>
Sent: Friday, August 04, 2006 10:14 PM
Subject: Re: [plt-scheme] continuation in top level begin form


>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.