Vesa Karvonen
Posts: 116
Nickname: vkarvone
Registered: Jun, 2004
|
|
Re: Designing the Heron Standard Library
|
Posted: Aug 5, 2005 3:37 PM
|
|
> what are the salient features of Ocaml signature
Well, the thing about ML-style signatures is that they provide a simple and (in a sense) complete way to specify abstractions. What I mean by simple should be inferable after a brief examination of signatures; a signature is just a specification of types and values (and submodules, but I'll ignore them in the following). As to what I mean by complete, unlike abstract classes or interfaces in typical OO languages, an abstraction described by an ML-style signature can be multi-sorted.
I would recommend reading chapter 8 of ATTAPL. It is an informal treatment of the subject and fairly accessible.
> relationship between a class and a module
In order to understant ML-style modules, I think that it would probably be better to forget about classes (and objects) and consider the relationship between ML-modules and things like Ada packages, C++ namespaces, Java packages, separate compilation, C/C++ header and implementation files.
> do OCaml signatures support multiple inheritance,
ML-signature matching is structural rather than nominal. There is no need to "inherit" a signature from another signature in order to match it. However, include provides a (bit simplistic) way to factor out common parts of signatures.
> non-abstract functions, and
Signatures contain specifications of types and values rather than (actual) types or values.
> parameterization.
As discussed in chapter 8 of ATTAPL, ML-style signatures support fibration. In practise, this means that you can "generate" new signatures from existing signatures by adding constraints (using with in Ocaml).
|
|