I think a good first question here is "what do you want to happen when you
are running the program from outside DrRacket?". DrRacket is, in a general
sense, designed to reflect extra information about how a program runs when
it can glean that information, but it isn't meant to be the only way that
Racket programs run, merely one of them. So what you want to think about
is: how can a program offer up information about itself (and what
APIs/values/data should that be)? and then: how can DrRacket (or other
things that run Racket programs, eg Racket Mode, or command-line racket or
a standalone executable, etc) get a hold of that information to show it in
a meaningful way?

There are some examples of success following generally this pattern: test
coverage is a means whereby a program is expanded, then instrumented by
some tool (via rewriting the program) such that the instrumented program
produces information about what parts of the program actually ran to its
context (which might be DrRacket but might also be the "cover" library).
Check Syntax (which runs automatically these days) expands the program and
records information about it (notably binding and bound occurrences of
variables) and then DrRacket and Emacs Mode let you work with that
information.

Robby



On Mon, Jan 4, 2021 at 1:46 PM Ben Ryjikov <bryji...@gmail.com> wrote:

> I’m sorry - I didn’t explain what kind of highlighting we’re looking for.
>
> We’re building a new #lang, and we want it so that sometimes when you run,
> DrRacket highlights a part of the program you are running. But we only want
> that in certain situations, so we want to create a function which we can
> call that would do the highlighting on demand.
>
> Are there any functions or libraries which can do that?
>
> We’ve managed to get highlighting through a tool (which is listed in
> info.rkt), but we’re struggling to get it on demand because we can’t easily
> find a way for the tool and the program to share code.
>
> Is there a way for a tool to access code which outside of the tool at
> runtime?
>
> -Ben
>
> On Jan 4, 2021, at 9:04 AM, Stephen De Gabrielle <spdegabrie...@gmail.com>
> wrote:
>
> On Mon, Jan 4, 2021 at 12:32 AM Ben Ryjikov <bryji...@gmail.com> wrote:
>
>> Hi Racket,
>>
>> Is it possible for a tool invoked by info.rkt to access code which is
>> outside of the tool?
>>
>> We’re building a #lang and would like to have on-demand syntax
>> highlighting.
>> We’ve tried using a tool, and have successfully made a button and a menu
>> item that do it, but we’d like to activate the highlighting
>> programmatically at runtime instead of by clicking on something.
>> We also are hoping to have multiple highlights at once if possible.
>>
>> Is there any way to get on-demand syntax highlighting without using a
>> button or menu item? Are there any pre-existing Racket tools or functions
>> that would do this?
>>
>
> I think datalog does this;
>
> <image.png>
>
>
>
>
>>
>> Thanks for your time and Happy New Year!
>>
>> Best,
>> Ben
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/BA1B6C4F-8172-462F-9E2D-8F6F2A9C6BB4%40gmail.com
>> .
>>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/C549A2BB-8999-496B-B119-70239EB13EDB%40gmail.com
> <https://groups.google.com/d/msgid/racket-users/C549A2BB-8999-496B-B119-70239EB13EDB%40gmail.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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdONeC8-gcw%3D5dRjY7J73EdYXja3P%3Ddrkb1GTo2JN305FsA%40mail.gmail.com.

Reply via email to