[plt-scheme] Invoking units

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Jun 14 20:58:42 EDT 2009

invoke-unit works only for units that don't need imports. Link first.  
(Yes, there is a way to use the lexical environment for the same  
purpose.)

-- Matthias


On Jun 14, 2009, at 8:14 PM, Paulo J. Matos wrote:

> Hi,
>
> My units are a bit rusty and deprecated (last time I used them was
> pretty much in 300 I guess). I have a unit that imports 3 thunks:
> #lang scheme
>
> (define-signature search^
>   ((contracted
>     (num-states (-> integer?))
>     (hash-states? (-> bool?))
>     (draw-graph? (-> bool?)))))
>
> (provide search^)
>
> and then I want to invoke the unit attaching a couple of values and  
> get
> the result of its last expression. I tried something like:
> (invoke-unit search@
>      (import
>           (lambda () 100)
>           (lambda () #t)
>           (lambda () #t))))
>
> but I am definitely missing something... I couldn't find any  
> example of
> invoke-unit (with imports) in the docs. Can anybody provide an example
> on how to attach values to the signature imports?
>
> Cheers,
>
> Paulo Matos
> http://www.pmatos.net
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.