[plt-scheme] Invoking units

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Sun Jun 14 20:14:18 EDT 2009


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^
    (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@
          (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?


Paulo Matos

Posted on the users mailing list.