[R6RS] library syntax

dyb at cs.indiana.edu dyb at cs.indiana.edu
Tue Jul 11 15:52:37 EDT 2006


> >     It also allows lambda bodies to contain interleaved commands and
> >     definitions.  I didn't allow this in the syntax srfi because I thought
> >     that the library srfi required all of the definitions to appear before
> >     all of the commands/expressions.
>
> Could you elaborate a tiny bit on the semantics?  I.e. do we still
> translate into letrec* (with dummy identifiers or something), what are
> the return values of the last body form is a definition, what are the
> return values if there are no expressions in the body?

Yes, we still translate into a letrec*, with dummy identifiers.  I presume
that for lambda, we would still require at least one expression after the
definitions, but we could leave the value unspecified if the last form is
a definition.

Personally, I prefer changing the syntax for both library and lambda
bodies to require that all of the definitions appear before all of the
expressions and to require at least one expression in a lambda body but
not a library body.  This makes converting legacy top-level code that
intermixes definitions and commands into libraries, but it just seems
cleaner to me.

Kent



More information about the R6RS mailing list