[plt-scheme] Invoking units

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

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



Posted on the users mailing list.