[plt-scheme] signed unit syntax

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Oct 27 16:30:02 EDT 2004

On Oct 27, 2004, at 4:16 PM, Stephen Tetley wrote:

> (define output-sqrt-sum-squares
>    (lambda (x y)
>      (begin
>        (invoke-unit/sig
>         (compound-unit/sig
>           (import)
>           (link
>            (COMP : c^ (sqrt-sum-squares@))
>            (OUT : o^ (simple-output@)))
>           (export (open COMP) (open OUT))))
>        (output (computation x y)))))

That won't work. You need to define these names like this:

(define output-sqrt-sum-squares.v1
   (lambda (x y)
      ((open c^) (open o^))
         (COMP : c^ (sqrt-sum-squares@))
         (OUT : o^ (simple-output@)))
        (export (open COMP) (open OUT))))
     (output (computation x y))))

I recommend my first email however. It scales better. -- Matthias

Posted on the users mailing list.