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 #<void> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to