[plt-scheme] Invoking units
On Mon, Jun 15, 2009 at 3:50 PM, Paulo J. Matos<pocmatos at gmail.com> wrote:
> On Mon, Jun 15, 2009 at 1:53 PM, Matthias Felleisen<matthias at ccs.neu.edu> wrote:
>>
>> You had the invoke wrong: foo is the main file. -- Matthias
>>
>>
>>
>>
>>
>
And of course, thank you very much for your help! :)
> So, in fact, I don't need to either use /infer or link the bindings manually.
> for the record, this is how I tried to solve it:
> (let ([test@ (dynamic-require gen-file 'test@)]
> [provider@ (unit (import) (export test^)
> (define (test x) (* 2 x)))]
> [full-unit@ (compound-unit
> (import)
> (export)
> (link (((TEST : test^)) provider@)
> (() test@ TEST)))])
> (invoke-unit full-unit@))
>
> I defined a compound unit without any imports/exports and invoked it.
>
> You solution seems to be more elegant. I didn't know invoke-unit on
> its own would deduce the static bindings for the signature.
>
> Cheers,
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> http://www.pmatos.net
>
--
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net