[racket] developing tools
On Sun, Sep 1, 2013 at 8:22 AM, Laurent <laurent.orseau at gmail.com> wrote:
> On Sun, Sep 1, 2013 at 2:54 AM, Robby Findler <robby at eecs.northwestern.edu
> > wrote:
>
>> Also, this might help with the dynamic-require approach:
>>
>>
>> http://docs.racket-lang.org/tools/drracket_get_extend.html?q=drracket%3Aget/extend%3Adisallow-re-extension%21#%28def._%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3aget%2Fextend~3adisallow-re-extension%21%29%29
>>
>
> Interesting! Looks like it could gain a lot of time.
> So I tried (but failed) to write a simple tool tester.
>
> #lang racket/base
> (require drracket/tool
> drracket/private/drsig
> drracket/tool-lib ; will open a new DrRacket frame at the end!
> racket/unit)
>
> ; The magic line
> (drracket:get/extend:allow-re-extension!)
>
> (define tool (dynamic-require "my-tool.rkt" 'tool@))
> (define-values/invoke-unit tool
> (import drracket:tool^))
>
> where my-tool.rkt contains the example code at the bottom of:
> http://docs.racket-lang.org/tools/implementing-tools.html
>
> But I'm very unsure about the unit stuff (first time with that, the Guide
> didn't help a lot here) and I the following error:
> drracket:debug:make-debug-eval-handler: unbound identifier in module in:
> drracket:debug:make-debug-eval-handler
> I don't know what to do about them (requiring some other files or adding
> imports in the invoke-unit did not help).
>
> What is weird is that if I remove the unit related stuff in my-tool.rkt,
> and add:
>
> (require drracket/tool-lib)
> (drracket:get/extend:allow-re-extension!)
>
> right before the drracket:get/extend:... lines, it works (opens a new
> frame with the new tool installed).
>
> Robby, it seems that there is not much to do to make it work, right?
>
>
The probably you're seeing with the define-values/invoke-unit line has to
do with the fact that I've let the drracket:tool^ signature and the exports
of drracket/tool-lib get way out of sync. I've brought them mostly back in
sync with a recent push but there seems to be a small problem with units
that stands in the way of that line actually working. But at least some
progress happened here....
Robby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131013/7e305889/attachment-0001.html>