In certain systems for object-oriented programming such as the Common Lisp Object System and Dylan, a generic function is an entity made up of all methods having the same name. Typically a generic function itself is an instance of a class that inherits both from function and standard-object. Thus generic functions are both functions (that can be called with and applied to arguments) and ordinary objects. The book The Art of the Metaobject Protocol explains the implementation and usage of CLOS generic functions in detail.
Flavors is one of the early object-oriented extensions to Lisp. It used the usual message sending paradigm influenced by Smalltalk. The syntax for sending a message in Flavors is:
(send object :message)With New Flavors it was decided the message should be a real function and the usual function calling syntax should be used:
(message object)message now is a generic function, an object and function in its own right. Individual implementations of the message are called methods.
The same idea was implemented in CommonLoops. New Flavors and CommonLoops were the main influence for the Common Lisp Object System.
Read more about Generic Function: Comparison To Other Languages
Famous quotes containing the words generic and/or function:
“Mother has always been a generic term synonymous with love, devotion, and sacrifice. Theres always been something mystical and reverent about them. Theyre the Walter Cronkites of the human race . . . infallible, virtuous, without flaws and conceived without original sin, with no room for ambivalence.”
—Erma Bombeck (20th century)
“Nobody seriously questions the principle that it is the function of mass culture to maintain public morale, and certainly nobody in the mass audience objects to having his morale maintained.”
—Robert Warshow (19171955)