[plt-scheme] about letrec and continuation : which behavior is correct ? and why ?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Aug 19 11:19:48 EDT 2008

On Aug 19, 2008, at 10:44 AM, Abdulaziz Ghuloum wrote:

>
> On Aug 19, 2008, at 7:10 AM, Matthew Flatt wrote:
>
>> The R5RS/R6RS `letrec' is different, and the result with that other
>> `letrec' should be #f:
>
> An R6RS implementation may (or may not) raise an &assertion when the
> <init> continuation is invoked the second time, right?  To me, that
> says that "it is an error" (in the R5RS sense) to evaluate an <init>
> continuation more that once, so, the program is incorrect.

I assume w/ "incorrect" you mean "is not a legal program".

It never ceases to amaze me that the Report specifies that some
syntactically legal expressions are NOT programs but you can only
find out (as far as I know) that they are NOT programs by RUNNING
them. (Of course all this means is that compilers and interpreters
accept and deal with 'things' that are not legal programs in the
spirit of a report, though I can't think of another language with
this property.)

-- Matthias



Posted on the users mailing list.