Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Generic function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== In Common Lisp Object System == In some systems for [[object-oriented programming]] such as the [[Common Lisp Object System]] (CLOS)<ref>[http://www.dreamsongs.com/Files/ECOOP.pdf The Common Lisp Object System: An Overview]</ref> and [[Dylan (programming language)|Dylan]], a ''generic function'' is an entity made up of all methods having the same name. Typically a ''generic function'' is an instance of a class that [[Inheritance (object-oriented programming)|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 use of CLOS generic functions in detail. One of the early object-oriented programming extensions to Lisp is [[Flavors (programming language)|Flavors]]. It used the usual message sending paradigm influenced by [[Smalltalk]]. The Flavors syntax to send a message is: <syntaxhighlight lang="lisp"> (send object :message) </syntaxhighlight> With New Flavors, it was decided the message should be a real function and the usual function calling syntax should be used: <syntaxhighlight lang="lisp"> (message object) </syntaxhighlight> ''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]].<ref>{{Cite web |url=http://www2.parc.com/istl/groups/gir/papers/stefik-commonloops-oopsla66.pdf |title=CommonLoops, Merging Lisp and Object-Oriented Programming |access-date=2009-12-10 |archive-url=https://web.archive.org/web/20110604013117/http://www2.parc.com/istl/groups/gir/papers/stefik-commonloops-oopsla66.pdf |archive-date=2011-06-04 |url-status=dead }}</ref> New Flavors and CommonLoops were the main influence for the Common Lisp Object System.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)