Aaron W. Hsu scripsit:

> Andre, you seem to think that it doesn't make sense to treat macros
> and procedures as consisting of two passes. However, this really *is*
> how things happen, and is consistent throughout the community. Code is
> expanded, and then evaluated. In the case of the REPL, this happens on
> a per form, one at a time level. In other contexts, this also usually
> happens at a per form level, but there is often a single module form
> encapsulating the syntax, and the whole code can thus be expanded in
> a single pass.

It all depends on what you think the semantics of module forms are.
One view is that "module" (or "library") is just a wrapper, like top-level
"begin", except that it adds the feature of systemantically renaming the
names defined by top-level definitions inside the wrapper.  The other
view is that library bodies are like non-top-level "begin" blocks (or
lambda bodies, or whatever): internal definitions followed by expressions.
Chicken (and maybe other systems) takes the first view, R6RS the second.

Either view is, I think, defensible, and the intersection of things that
work the same in both views is considerable: define macros before using
them, make sure all expressions are at the end.

-- 
John Cowan    http://ccil.org/~cowan    [email protected]
SAXParserFactory [is] a hideous, evil monstrosity of a class that should
be hung, shot, beheaded, drawn and quartered, burned at the stake,
buried in unconsecrated ground, dug up, cremated, and the ashes tossed
in the Tiber while the complete cast of Wicked sings "Ding dong, the
witch is dead."  --Elliotte Rusty Harold on xml-dev

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

Reply via email to