polymorphism
polymorphism A feature of some modern high-level programming languages that allows arguments to procedures and functions to vary systematically over a whole class of data types, rather than being restricted to a single type. A simple example would be a function to find the length of a list. The code for such a function should be the same for lists of integers, lists of Booleans, or lists of anything. In a language like Pascal, however, the argument to such a function must have a single type; hence to handle both lists of integers and lists of Booleans, two functions would have to be defined. This can be avoided in languages (such as ML) that support polymorphic types like “list of alpha”, where alpha is a type variable standing for an arbitrary type. A polymorphic function is one that takes one or more arguments of polymorphic types.
More From encyclopedia.com
NEARBY TERMS
polymorphism
