Go backward to Universal Polymorphism
Go up to Top
Go forward to Overloading and Coercion
Ad-hoc Polymorphism
- Overloading
- Same name denotes different functions.
- Context decides which function is denoted by particular occurence of a
name.
- Preprocessing may eliminate overloading by giving different names
to different functions.
- Coercion
- Type conversions convert an argument to a type expected by a
function.
- May be provided statically at compile time.
- May be determined dynamically by run-time tests.
- Only apparent polymorphism
- Operators/functions only have one type.
- Only syntax "pretends" polymorphism.
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: understand.tex,v 1.1 1996/06/12 09:38:21 schreine Exp schreine