Making expanded bindings visible in top-level

31 views
Skip to first unread message

Sage Gerard

unread,
Sep 6, 2020, 8:53:29 PM9/6/20
to Racket Users
I'm writing a variant of setup/infotab to allow `#%top-interaction' plus some other bindings of my choice. But when I create a evaluator in the context of such a module, `#%info-domain' and `#%info-lookup' are not bound. I'd like to use a REPL to access these procedures.

Is there a cleaner way to make the #%info-* procedures use the same lexical context without forcing each through syntax->datum and datum->syntax?

~slg


Sorawee Porncharoenwase

unread,
Sep 6, 2020, 10:16:08 PM9/6/20
to Sage Gerard, Racket Users

I think it’s only enough to fabricate the #%info-* identifiers. For example, in the file you linked above, you can add:

[#%info-domain (datum->syntax stx '#%info-domain)]

to with-syntax, and provided that you provide #%top-interaction, you should be able to use #%info-domain in the REPL.


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/HXI6OiTdOS3GiXhHp6tG2xC6vTPzNPublNDjosc_vQfNDtIrU1XjmheFOPoQLGQ4rmzmgOzbkRMJ-p1FvZngtIjLU-JAfVKHS0ZE6_wUstc%3D%40sagegerard.com.

Sage Gerard

unread,
Sep 7, 2020, 2:04:35 AM9/7/20
to Sorawee Porncharoenwase, Racket Users
Ah, thank you. I didn't think that the original syntax object would have the lexical information I needed. For some reason I thought about constructing a syntax object using the name pattern variables and using that instead.

~slg


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Reply all
Reply to author
Forward
0 new messages