[plt-scheme] Importing a signature in unit as import-id

From: Evangelos Tsagkas (lunluc at gmail.com)
Date: Sun May 14 08:13:26 EDT 2006

Is there a way to make the following work?

(require (lib "unit.ss")
         (lib "unitsig.ss"))

(define-signature generic^ (go))
(define-signature wbf^ (a b c))

(define wbf@
  (unit/sig wbf^ (import)
    (define (a x)
      (display "a from ")(display x)(newline))
    (define (b x)
      (display "b from ")(display x)(newline))
    (define (c x)
      (display "c from ")(display x)(newline))))

(define generic@
  (unit/sig generic^ (import (wbf : wbf^))
    (define (go)
      (wbf:a "fox")
      (wbf:b "box")
      (wbf:c "locks"))))

(define result@
  (unit  (import a-signature^
         (export res@)
         (define res@
           (compound-unit/sig (import)
                              (link (MOD : (open a-signature^) (a-module@))
                                    (GENERIC : generic^ (generic@ MOD)))
                              (export (open GENERIC))))))

(define-values/invoke-unit (res@) result@ m wbf^ wbf@)

Evangelos Tsagkas

if feeling is first who pays any attention to the syntax of things
will never wholly kiss you
-- ee cummings

Posted on the users mailing list.