[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.3 The "full" model

This model is the recommended full bells-and-whistles model for Mosmake. It works like the "native" model, except that there is a third file called `foo-sig.sml'. This file is compiled to `foo-sig.ui' (and `foo-sig.uo'); thereafter `foo-sig.ui' is included in the compilation of `foo.sig' and `foo.sml'.

Typically `foo-sig.sml' defines a signature, and `foo.sig' contains a single line declaring that `foo.sml' exports a unit with that signature. Example:

`foo-sig.sml' contains:

 
signature FOO = sig
    datatype fuzzy = Yes | Maybe | No
    val certain : fuzzy -> bool
    (* ... *)
end

`foo.sig' contains:

 
structure Foo : FOO

`foo.sml' contains:

 
structure Foo :> FOO = struct
    datatype fuzzy = Yes | Maybe | No
    val internal = "I'm not exported from the unit"
    fun certain Yes = true
      | certain _ = false
    (* ... *)
end

The `-sig.sml' file is compiled in the same environment as the `.sig' file -- that is, the units it may depend on are those before the plus sign on the unit's `Dependencies' line. See plus sign.

Use the "full" model


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Henning Makholm on November, 19 2002 using texi2html