This reminds me of a similar thread on Slack yesterday.

When a macro `define`s something, it's usually better for everyone if
the identifier is supplied to the macro. It's nicer for you as the
macro writer because you don't need to think so hard about scope and
hygiene. And it's nicer for the user of the macro, not to have
identifiers injected.

It's usually OK to bend this rule, and make new identifiers based off
one supplied to the macro. For example, `(struct foo (bar))` will
define a `foo-bar` accessor. If you do something similar, using
format-id correctly to make `foo-bar` given `foo`, it should
"just-work". The format-id docs have a simple first example:
https://docs.racket-lang.org/reference/syntax-util.html#(def._((lib._racket%2Fsyntax..rkt)._format-id))

So I usually try to start on that happy, simple path.

On Wed, Mar 6, 2019 at 11:42 PM David Storrs <david.sto...@gmail.com> wrote:
>
> On Wed, Mar 6, 2019 at 11:31 PM Sorawee Porncharoenwase
> <sorawee.pw...@gmail.com> wrote:
> >
> > Isn’t this because of hygienity in general?
>
> *headdesk*
>
> Of course.  Thanks, I should have recognized that.
>
> --
> 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