Fri Jan 21 09:33:45 EST 2011

Racket (PLT) units

To create parameterized (open) code that can later be combined to
create real code.  All parameterized names are values, not macros.
However, it is possible to define macros _as part of a signature_, in
terms of the parameterized values.

To use:

  * `define-signature' creates an interface that can be used in
    imports and exports.  It is a collection of variable names and
  * `unit' creates a unit object, which is a first class object with
    "holes" as specified by the signatures mentioned in `import'.  

  * Multiple units can be composed through "linking".

  * A unit with no imports can be "invoked" to execute its body.

I managed to use `define-unit' and `define-compund-unit/infer', but
not `unit' and `link'.  There seems to be extra static information in
the former case which then has to be provided to `link', while the
former passes that static information automatically.

[1] http://docs.racket-lang.org/reference/mzlib_unit.html