Chapter 3
Polymorphism and Message Passing
Overview
-
Polymorphic functions are
functions that can handle several different
types of arguments.
We look at ways of implementing such functions.
First we present three Lisp-like
implementations using dispatch
tables, data-driven programming, and message passing.
Then we look at various ways of implementing
objects, that is,
data elements that have built in all the functions that
can be applied to them.
This concept provides for a high degree of modularity
and lays the groundwork for a discussion
of object-oriented programming in Chapter 4.
Programs
CmplxA1.m
CmplxDis.m
CmplxD1.m
LookupTable.m
CmplxTab.m
CmplxM1.m
CmplxMsg.m
CmplxA.m
RectObjects.m
AccountObjects.m
Spirals.m

Rev. 1.0, REM, © 1996 Roman E. Maeder