Contents    Page-10    Prev    Next    Page+10    Index   

Type Equivalence

If types are required to match, the question of what types are considered to be ``equivalent'' arises.

Structural equivalence requires equivalent structures (tree equivalence, as in the Lisp function equal), i.e.,

However, there is still a question as to what things are included when testing equivalence, e.g., array bounds and record field names. Implementations of the ``same'' language may vary.

Name equivalence considers types to be equal only if the same names are used.

C uses structural equivalence except for records, for which name equivalence is used.