Possibly the problem here is that the origin tracking doesn't interact
well with begin splicing. That could be changed, I suppose, but using
void seems more natural. Maybe best to cooperate with the language
you're using to ask them offer you a value that doesn't print out?
Robby
On Wed, Aug 3, 2016 at 10:05 AM, Dupéron Georges
wrote:
> I have two files, `a.rkt` and `b.rkt`:
>
> ;; a.rkt
> #lang racket
> (provide foo)
> (define-syntax (foo stx)
> ;; Do some compile-time side effects here…
> #'(begin))
>
> ;; b.rkt
> #lang racket
> (require "a.rkt")
> (foo)
>
> The `foo` macro defined in `a.rkt` does some side effects, and expands to
> `(begin)`. When `b.rkt` is opened in DrRacket, there is no arrow drawn from
> `foo` to the require clause, and the require clause is marked as unused (red
> background when hovering it.
>
> How can I get the arrow from `foo` to "a.rkt", while keeping the same
> semantics?
>
> * If I change `foo` so that it expands to `(begin-for-syntax)`, then the
> arrow is correctly shown, but the macro can't be used in expression contexts.
>
> * If I change `foo` so that it expands to `(void)`, then the arrow is
> correctly shown, but it changes the semantics (whether # values are
> displayed or not during execution depends on the language)
>
> * The only solution I found is to change `foo` so that it expands to `(define
> dummy (void))`. Since the macro is hygienic, the `dummy` definition is
> inaccessible. It does feel a bit clunky though, is there a better solution?
>
> --
> 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.