Mapping elements to functions. Translator uses runtime type
information (RTTI) to determine the concrete type of a generic function
argument. This mechanism is very language dependent and may also vary with
different compilers for one language. Usually, it is possible to obtain a
string of the class name or test for successful downcasting to a specific
type. If no such mechanism is available, one is left with explicitly
programming a type inquiry interface. This is, however, incompatible to
the otherwise non-intrusive nature of Translator.
In any case, a generic function may also dispatch on values of
objects as opposed to their type. Consequently, you may represent musical
notes and quarter notes by the same class. The corresponding objects will
differ in a value, e.g., of attribute duration. Nevertheless, it
is still possible to use a generic function to dispatch on this note
representation.