[R6RS] Internal DEFINE vs. macros

Michael Sperber sperber
Tue Apr 12 11:48:15 EDT 2005


>>>>> "Kent" == R Kent Dybvig <dyb at cs.indiana.edu> writes:

>> I didn't mean the interactive top-level, but rather the outermost
>> level of the core language.  This is inherently different from
>> internal contexts because of shadowing.  The semantics of this should
>> be specified as precisely as that of internal contexts for the same
>> reasons.

Kent> But I thought your notion of core language did not include
Kent> top-level definitions, just module forms.

By "core language" I meant the language corresponding to R5RS.  In
Chez, it would be the top level.  In Scheme 48 or PLT, it would be the
module body---the level corresponding to R5RS.

Kent> Forgive me from being dense, but doesn't this mean that all
Kent> definitions are internal?

No, because you can't have shadowing-by-nesting at the top level.
That's where the (most serious, IMHO) ambiguities come from.

Kent> I think you are running up against the fact that Chez Scheme does
Kent> not treat the forms within a let-syntax and letrec-syntax as bodies;
Kent> instead, let-syntax and letrec-syntax are treated like begin.  This allows
Kent> let-syntax and letrec-syntax forms to be treated as definitions in the
Kent> same sense that begin is treated as a definition.

OK, I accept the explanation, but this behavior is highly confusing to
me.  It's also another facet of this whole thing to pin down.

Also, I'm curious what the rationale for this in Chez is.  Couldn't
you just get the same effect (macros local to a set of definitions)
via MODULE?

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla


More information about the R6RS mailing list