[Scheme-reports] equivalent rewrite of a sequence of (syntax) definitions? Daniel Villeneuve (04 Jan 2013 03:08 UTC)

[Scheme-reports] equivalent rewrite of a sequence of (syntax) definitions? Daniel Villeneuve 04 Jan 2013 03:03 UTC

Without syntax definitions, a sequence of definitions is
equivalent to a letrec* form (Section 5.3.2).

With syntax definitions, since this is explicitly not covered by Section
5.3.2,
the wording of Section 5.4 should be used.  However, it is not said:
- what happens with too mutually recursive syntactic definitions;
- how to split subsequences of regular and syntactic definitions.

I would propose the following rewrite:

Given a sequence of definitions and syntax definitions at the start of
a <body>, let r_i be the identifier bound by the i^{th} definition v_i
and s_i be the identifier bound by the i^{th} syntax definition d_i.
Then, the entire sequence of definitions and syntax definitions
is equivalent to

(letrec-syntax ((s_i d_i) ...)
   (letrec* ((r_i v_i) ...)
<expressions>+))

Is this a plausible rewrite?

I know it conflicts with the wording at the end of Section 5.4 which says

 > Any use of a syntax keyword before its corresponding definition is
 > an error.

but if the above rewrite is "correct", this error condition could be
dropped.
--
Daniel Villeneuve

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports