<div dir="ltr"><div><div><div><div><div><div>I'm currently trying to write a #lang with a built-in analysis visualization in DrRacket. The idea is that when I open a program written in this #lang, a "Run Analysis" button should appear. When the button is clicked, it should run the analysis and draw syntax-check-like arrows in the definitions window to show the results of the analysis.<br>
<br></div>To do this, I'm using some code Ryan Culpepper wrote as part of the macro-debugger collection that provides a mixin for drawing arrows. The problem is that when I try to extend DrRacket using drracket:get/extend:extend-definitions-text, I get the "cannot instantiate `racket/gui/base' a second time in the same process" error. Here's a trimmed down version of the code:<br>
<br></div>;; tool-lang-example/main.rkt:<br><br>#lang racket<br><br>(provide (all-from-out racket)<br> get-info)<br><br>(require drracket/tool-lib)<br><br>(define (get-info info-kind default-value default-filter)<br>
(default-filter info-kind default-value))<br><br>(drracket:get/extend:extend-definitions-text (lambda (x) x))<br><br></div>;; tool-lang-example/lang/reader.rkt:<br><br>#lang s-exp syntax/module-reader tool-lang-example #:info get-info<br>
<br>(require tool-lang-example)<br><br>;; --<br><br></div>I also tried using lazy-require for drracket/tool-lib, but to no avail.<br><br></div>Is it possible to get this to work just as a #lang, without creating a separate tool?<br>
<br></div>-Jonathan<br><div><div><div><div><div><div><br></div></div></div></div></div></div></div>