[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] equivalent rewrite of a sequence of (syntax) definitions?
On 03/01/13 11:06 PM, Alex Shinn wrote:
> On Fri, Jan 4, 2013 at 12:03 PM, Daniel Villeneuve
> <dvilleneuve@x <mailto:dvilleneuve@x>> wrote:
>
> 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.
>
> Mutually recursive syntactic definitions work as they always
> have. I'll see if I can clarify the language, but basically this
> works just like the top-level - the variables and syntax all refer
> to each other. Redefinitions are forbidden, and obviously
> actually using a value before it is lexically occurs is an error.
>
> There's no need or desire to split syntax and non-syntax.
My attempt to split was a consequence of there being no
binding construct that covers both regular and syntactic definitions.
Maybe letrec* could be extended to accept syntactic definitions?
I proposed this rewrite because it seems to me that using
a formal rewrite rule is a sounder definition method than just wording.
> I would propose the following rewrite:
>
>
> (letrec-syntax ((s_i d_i) ...)
> (letrec* ((r_i v_i) ...)
> <expressions>+))
>
>
> Unfortunately this rewrite wouldn't work - it's important that the
> syntax definitions refer to the non-syntax definitions, thus they
> must all be in the same lexical contour.
Indeed.
> --
> Alex
>
--
Daniel
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports