Combining structural subtyping and external dispatch
作者
Donna Malayeri
标识
DOI:10.1145/1297846.1297961
摘要
By-name subtyping (or user-defined subtyping) and structural subtyping each have their own strengths and weaknesses. By-name subtyping allows programmers to explicitly express design intent, and, when types are associated with run time tags, enables run-time "type" tests and external/multimethod dispatch. On the other hand, structural subtyping is flexible and compositional, allowing unanticipated reuse. To date, nearly all object-oriented languages fully support only one subtyping paradigm or the other.