Contents    Page-10    Prev    Next    Page+10    Index   

Polymorphic Procedures

A procedure that has multiple type signatures is called polymorphic. In the case of operators, the use of the same operator with different types is called overloading.

+ : integer X integer → integer
+ : real X real → real

Polymorphic procedures are often found in object-oriented programming:


(defmethod move-to ((self drawable)
                    (x integer) (y integer))
  (send self 'erase)
  (send self 'set-pos x y)
  (send self 'draw) )