You really want to parametrize foo over x for such things. (Or use a syntax 
parameter.) 


On Feb 10, 2016, at 3:26 PM, Matthew Butterick <m...@mbtype.com> wrote:

> I suspect there's a simple way to do this, I just haven't done it before, so 
> it does not appear simple. I tried a syntax parameter, and then I had two 
> problems.
> 
> Please consider this schematic example (no, I am not using macros to add):
> 
> #lang racket
> (define-syntax-rule (foo) (+ x x))
> (define-syntax bar (make-rename-transformer #'foo))
> 
> `(foo)` will fail with an undefined-identifier error because there is no 
> binding for x. As will `(bar)`, because it just refers to `(foo)`.
> 
> Q: At the definition site of `bar`, is there a way to bind x so that it 
> affects `foo`, and `(bar)` thereby produces a meaningful answer?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to