On Mon, 14 Sep 2009, Per Bothner wrote:

> On 09/14/2009 12:42 PM, Alaric Snell-Pym wrote:
>> In summary, I think I agree, with the rationale that having one rule
>> for everything - toplevels, REPLs, library bodies, and implicit or
>> explicit begins, or as close as possible to the same rule for
>> everything - provides "least surprise".
>
> It's not that easy, I fear.  You still need to handle forward
> references:
>
> (define (foo x) (if ... (bar x)))
> (define (bar x) (if ... (foo x)))
>
> The "traditional" behavior is that we treat the top-level
> environment special, and dynamically: If we don't see a
> lexical binding, punt to a run-time lookup.  But that
> doesn't work once we have libraries which have their
> own internal namespace, which is distinct from the
> dynamic top-level.  At least it becomes a lot more
> complicated.

True, it may be slightly more complicated, depending on how
your implementation currently handles such things, but it is
still relatively easy to make a library behave just
like a toplevel.

Andre

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to