[racket] Extending definitions window as part of #lang

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jul 23 23:51:26 EDT 2013

If I understand correctly, you need to actually make a drracket plugin,
since you want to change the way DrRacket behaves. DrRacket does let you
customize some things by specifying properties as part of a new #lang, but
not arbitrary mixins of the definitions text.


On Tue, Jul 23, 2013 at 5:48 PM, Jonathan Schuster <schuster at ccs.neu.edu>wrote:

> 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.
> 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:
> ;; tool-lang-example/main.rkt:
> #lang racket
> (provide (all-from-out racket)
>          get-info)
> (require drracket/tool-lib)
> (define (get-info info-kind default-value default-filter)
>   (default-filter info-kind default-value))
> (drracket:get/extend:extend-definitions-text (lambda (x) x))
> ;; tool-lang-example/lang/reader.rkt:
> #lang s-exp syntax/module-reader tool-lang-example #:info get-info
> (require tool-lang-example)
> ;; --
> I also tried using lazy-require for drracket/tool-lib, but to no avail.
> Is it possible to get this to work just as a #lang, without creating a
> separate tool?
> -Jonathan
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130723/4d44ec43/attachment-0001.html>

Posted on the users mailing list.