Previous: Stand-Alone Routine Implementations
Routine and method implementations, as well as classes, can be
parameterized. Within the scope of a parameterized implementation,
formal parameters can be used as types whose objects have only the methods
and signatures indicated in the where clause. For example, in
find [T] (x: collection[T], v: T) returns (int) signals (not_found)
where T has equal(T) returns (bool)
if v = w ... % short for v.equal(w)
the call "v.equal(w)" (made using the associated short form) is legal.
calls make sense because instantiations are only permitted for types
whose objects have the required methods (3.2.2).