jhallen@world.std.com (Joseph H Allen) writes:>Last week I was invited to join a Thesis (MsC) presentation.>At some point a question raised about the exact difference between>Polymorphism and Overloading.

Roughly said:
You have overloading if MULTIPLE functions share a SINGLE
interface, each for a particular combination of parameter types.
You have polymorphism (in the strict sense) if a SINGLE function
has a single interface for MULTIPLE combinations of parameter types.

Note that inheritance in the OO sense can be seen as a combination of
overloading and polymorphism.

I don't know what you mean exactly by 'require a dot or -> somewhere',
but calls to overloaded functions need not be syntactically different
from calls to polymorphic functions. It might be that certain languages
require such a difference (I don't know of any).

>Next question: is there a difference between the functional language notion>of a polymorphic type and inheritance (other than functional language type>hierarchies being limited to one level)?

Mmm, this is tricky question, especially because the functional
language 'polymorphic type' and 'type hierarchy' are different notions,
and IMHO type-hierarchies need not be limited to one level.

The difference between a type-hierarchy and inheritance lies in
dynamic binding: type-hierarchies usually require the actual type to
be know at compile time, with inheritance the actual type can be
unknown until run time.

For more information on the different between polymorphism and
overloading, take a look at the exellent article: