[plt-scheme] compound mutually recursive units

From: Keiko Nakata (keiko at kurims.kyoto-u.ac.jp)
Date: Thu Jan 22 10:31:59 EST 2009

Hello.

I want to compound a unit from several units to form recursive
bindings, where the imports of a constituent unit are 
supplied by several other constituents; I cannot figure out how to do
this concisely. 

Here is a snippet from my code, which implements a toy language: 

;; heap
(define-signature Heap_import^ (eval_cexpr eval_mexpr))
(define-signature Heap_export^ (heap_locate new_location eval_location))
(define-unit Heap@  (import Heap_import^)  (export Heap_export^) ... )
  
;; the core language
(define-signature Cexpr_import^ (eval_location))
(define-signature Cexpr_export^ (subst_cexpr eval_cexpr))
(define-unit Cexpr@ (import Cexpr_import^) (export Cexpr_export^) ...)

;; the mixin language 
(define-signature Mexpr_import^ (heap_locate new_location eval_location subst_cexpr))
(define-signature Mexpr_export^ (eval_mexpr))
(define-unit Mexpr@ (import Mexpr_import^) (export Mexpr_export^) ... )


I want to compound all the three units Heap@, Cexpr@ and Mexpr at .
An easiest way seems to split up signatures in pieces, which does not
sound very elegant. 

I appreciate any advice. 

Kind regards,
Keiko







Posted on the users mailing list.