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

From: Abdulaziz Ghuloum (aghuloum at cs.indiana.edu)
Date: Tue Aug 19 13:24:16 EDT 2008

On Aug 19, 2008, at 8:19 AM, Matthias Felleisen wrote:

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

It goes by the same spirit in which the Report specifies that
some S-expressions (a.k.a. datum) are NOT syntactically legal
(as programs) but you can only find out that they are NOT
syntactically legal by EXPANDING* them.  Scheme is not unique
in this aspect (e.g., C++ can only be syntactically verified
by expanding the templates).


[*] expanding a program means running it through the expander
which is a sort-of evaluator whose input is an S-expression
with a suitable environment and whose output is a syntactically
legal expanded program.

Posted on the users mailing list.