Ciao,
it is my understanding that, if I write a macro as follows:
(import (scheme)
(chicken fixnum))
(import-for-syntax (scheme)
(only (chicken syntax)
er-macro-transformer))
(define-syntax spiffy
(er-macro-transformer
(lambda (input-form.stx rename compare)
(define %fx+ (rename 'fx+))
---)))
the function RENAME will pick "fx+" from the runtime environment (which
is level 0).
I would like to write such macro as:
(import (scheme)
(chicken fixnum))
(import-for-syntax (scheme)
(only (chicken syntax)
er-macro-transformer)
(only (my-lib)
doit))
(define-syntax spiffy
(er-macro-transformer
(lambda (input-form.stx rename compare)
(define %fx+ (doit rename))
---)))
and in the library "(my-lib)" I have:
(define (doit rename)
(rename 'fx+))
but for this to work cleanly: in "(my-lib)" I should import "fx+" at
level -1? Is it right?
This is possible with R6RS implementations. How about CHICKEN?
TIA
--
Marco Maggi
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users