[Oberon] Clarifying type compatibility in Oberon-07
dsar at eml.cc
Sun Oct 8 07:22:58 CEST 2017
On Sun, Oct 8, 2017, at 07:00 AM, Chris Burrows wrote:
> It all depends on your interpretation of the words 'same', 'equal',
> In 'Programming in Oberon' (2015) when discussing parameter
> compatibility, Wirth says:
> "If a formal parameter type denotes an array structure, its corresponding
> actual parameter must be an array of the *identical type*. This implies
> that it must have *elements of identical type* and the *same bounds* of
> the index range." That sounds more like structure compatibility than name
> compatibility to me.
Wirth always uses "same" and "identical" as synonyms. If you compare the
Report and PIO, they are often exchanged.
However, name equivalence *implies* structural equivalence, but the
viceversa doesn't hold. You can find this argument in any type theory
book. This is what he means in that sentence (otherwise he would have
used *equivalent* or other another term for equality, not implication),
because in that paragraph he's introducing the concept of the open
array, where structural equivalence is not enough.
More information about the Oberon