Definitions - The HAC Language
Description: The HAC Language

Next: Definition Completeness and Usability, Previous: Parameters, Up: Types

### 2.2 Definitions

random notes, please pardon the lack of order... we really need to re-organize this document, I know.

Consider introducing templates up front...

Describe definition and type-system, bottom-up, from instantiations?

TODO: make the following distinctions: A physical definition corresponds to the complete description of a particular implementation. Physical definition has its own concrete layout map that translates name (possibly with index) to offset. (Users never directly deal with concrete layout maps.) Non-template definitions have only one trivially-generated concrete layout map. Template definitions, however, may have multiple layout map templates, among which one is selected to generate a concrete layout map for each instantiation. Layout templates are just value- and type-parameterized layout descriptions. (Multiple layout templates arise from partial and full specializations; a generic template definition contributes one layout template.)

A type can either be a reference to a non-template definition (which may be built-in) or a reference to a template definition with a set of parameters.

STALE: Two (non-template) types are equivalent if and only if they refer to the same non-template definition. In Templates we extend the notion of type-equivalence to cover types with templates.