On Sat, Jul 13, 2019 at 08:26:56AM +0200, Marco Maggi wrote: > 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?
Hi Marco, This won't work. "rename" is operating in the syntactic environment of the transformer. You can pass it as a procedure to some other module, but that won't change its internal state. > This is possible with R6RS implementations. How about CHICKEN? That is very surprising to me. It should not be possible. You're probably comparing apples and oranges (syntax-case works differently from ER macros). Cheers, Peter
signature.asc
Description: PGP signature
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users