See
https://docs.racket-lang.org/reference/stxtrans.html#%28def._%28%28quote._~23~25kernel%29._syntax-local-introduce%29%29
for
an example program that requires a library via a macro.

On Thu, Nov 12, 2020 at 3:09 AM Veit Heller <[email protected]> wrote:

>
> Hello,
>
> I’m suspecting I’m getting a little turned around by phase levels and
> where `require` comes in: it seems to be impossible to write a macro that
> expands to a valid `require` (it doesn’t throw an error, but the functions
> aren’t defined either). What am I missing? At what phase level does
> `require` do its magic? And can I tap into this magic from within a macro?
>
> An example to illustrate my point:
>
> ```
> (define-syntax require-distributed ()
>   ((_)
>     (require racket/place/distributed))) ; could be anything, really
> (require-distributed) ; expands and runs fine, but no symbols :(
> ```
>
> I know that this is somewhat of an odd thing to want, and I understand if
> it’s not possible.
>
> V
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/a49ab428-ae49-45ce-9d16-8a77d27f5a85n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/a49ab428-ae49-45ce-9d16-8a77d27f5a85n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegsm45NnAdw-yAqNUPKnytasXuvV0yoNQiW6cb-xu43tVw%40mail.gmail.com.

Reply via email to