[plt-scheme] compound-unit/sig

From: Neil W. Van Dyke (neil at neilvandyke.org)
Date: Sun May 18 10:07:37 EDT 2003

As an exercise, I played with using compound-unit/sig to make locale
mechanisms pluggable in an SRFI-19 implementation.

The following seems to work, but could someone who understands
modules/units/sigs better tell me if I'm doing it suboptimally?

    (module srfi19-nolocale mzscheme

      (require (lib "unitsig.ss")
               "locale-sig.ss"
               "srfi19-sig.ss"
               "dummy-locale.ss"
               "base.ss")

      (define srfi19-nolocale@
        (compound-unit/sig
          (import)
          (link   (LOCALE : locale^ (dummy-locale@))
                  (BASE   : srfi19^ (base@ LOCALE)))
          (export (open BASE))))

      (define-values/invoke-unit/sig srfi19^ srfi19-nolocale@)

      (provide-signature-elements srfi19^))

-- 
                                             http://www.neilvandyke.org/


Posted on the users mailing list.