Anonymous user
Type compatibility: Difference between revisions
m
Some grammar, a link
(Created) |
m (Some grammar, a link) |
||
Line 1:
[[Category:Encyclopedia]]'''
* by name (nominal equivalence);
* by structure (structural equivalence).
In a more general context
A structural matching is necessarily based on
==Nominal equivalence example (in [[Ada]])==
<ada>
Line 21:
Y : not null access String := X; -- This is OK
</ada>
The anonymous type of X matches the anonymous type of Y. The structure of both types is the same: "a pointer to String". Further, the constraint ''not null'' put on the type of Y does not effect equivalence because it is also structural.
|