[R6RS] Internal DEFINE vs. macros
dyb at cs.indiana.edu
Mon Apr 11 15:59:22 EDT 2005
> - Is it important to precisely define the semantics of macro
> expansion? (I would say yes---people run across ambiguities in R5RS
> macros. Manuel has just pointed out that others lurk in other
> corners of the hygienic macro system.)
I think it would be nice to precisely define the semantics, at least
informally. That said, we don't often run into problems where, for
example, Chez Scheme and DrScheme differ in practice, so while there
are such cases, they don't seem to arise. In my own experience, which
is extensive, I rarely see any code in which scoping rules are
stressed in ways highlighted by your examples.
> - Kent and Matthew: can you offer suggestions on how to specify the
> semantics of internal DEFINE-SYNTAX? Is there a simple way to do
Yes, I can and will if I end up writing up a syntax-case proposal more
formally. I believe it can be reasonably simple.
> - How far should we make the top level and local environments
> analogous? In the abstract, it seems a desirable goal to make them
> as analogous as possible, but to me, it also seems quite difficult
> and complicated. If they don't work the same way, the more similar
> they look, the harder it becomes to explain the differences.
I agree that making top-level and internal contexts behave similarly would
be useful. What people usually mean by this is that internal contexts
should behave like their favorite Scheme system's interactive top-level
environment behaves, which is impossible if we don't standardize on the
interactive environment. I don't think we want to try to do that.
Should we change what internal definitions look like or flush them
entirely because their semantics may not be precisely the same as the
semantics of a top level that we don't fully specify? No. I think we
should keep internal definitions and allow implementors to make their
interactive top levels as similar to or as different from internal
contexts as they please.
Perhaps you mean something different by making top level and local
More information about the R6RS