I should've been clear that the loop example was taken from the
Chicken scheme wiki. Same for the while example mentioned in the
email:
https://wiki.call-cc.org/man/4/Macros#ir-macro-transformer
Using the syntax->datum here would drop lexical information though; if
the syntax object given to the m
Thanks for the responses. In case anybody is interested, I came up with the
following implementation. Since (at least in this simple implementation)
there is an obvious symmetry between explicit renaming and implicit
renaming I added the er-macro-transformer also. They seem to work
correctly. O
I think the following program illustrates the idea, though it doesn't
really work:
#lang racket
(begin-for-syntax
(define (syntax-pair->cons stx)
(define datum (syntax-e stx))
(cond
[(list? datum)
(map syntax-pair->cons datum)]
[(pair? datum)
(cons (syntax-pair
For future reference, you should try the wonderful macro stepper in
DrRacket, which shows you exactly how expansion happens. It can even handle
buggy, non-terminating examples like the version of `test` you wrote.
-Philip
On Wed, Aug 29, 2018 at 7:20 AM Philip McGrath
wrote:
> I'm not familiar
I'm not familiar with how `ir-macro-transformer` is supposed to work, but
your macro is currently fails for essentially the same reason as:
(define-syntax (diverge stx)
stx
The `expr` given to `test` is a syntactic list beginning with the
identifier `test`, so including it in the output triggers
5 matches
Mail list logo