[r6rs-discuss] [Formal] Remove double phase semantics (fwd)
I am posting this as an individual member of the Scheme
community. I am not speaking for the R6RS editors, and
this message should not be confused with the editors'
eventual formal response.
AndrevanTonder wrote:
> Here is a simple example. I am not claiming that this is an example of good
> style, or that libraries should be written this way, but hopefully it
> illustrates the point:
It certainly illustrates my point.
> (library foo
> (export counter)
> (import r6rs)
> (define counter
> (let ((x 0))
> (lambda ()
> (set! x (+ x 1))
> x))))
>
> (library bar
> (export)
> (import r6rs (for foo run expand))
> (let-syntax ((m (lambda (e) (counter))))
> (display (list (m) (counter)))))
>
> (library baz
> (export)
> (import bar))
>
> ;==> (1 1) in the separated binding semantics always
> (1 1) in the shared semantics with separate compilation
> (1 2) in the shared semantics with compilation/run in same
> image
Are you sure that example is legal with the separated
binding semantics? It looks to me as though the m
macro transcribes uses of m into a macro-time integer,
which has nothing whatsoever to do with a run-time
integer, and *must* therefore cause a syntax error.
For your example to work *at all* with the separated
binding semantics, the macro expander would have to
perform an automagical transformation from macro-time
representations to run-time representations.
I repeat my questions: Does your reference implementation
perform that transformation? If so, how?
Will
Received on Sun Nov 26 2006 - 15:38:57 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:00 UTC