emacs.d/clones/lisp/www.cliki.net/clos.html
2022-10-07 15:47:14 +02:00

126 lines
No EOL
9.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CLiki: CLOS</title>
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
href="https://www.cliki.net/site/feed/article.atom?title=CLOS">
<link rel="stylesheet" href="static/css/style.css">
<link rel="stylesheet" href="static/css/colorize.css">
</head>
<body>
<span class="hidden">CLiki - CLOS</span>
<div id="content"><div id="content-area"><div id="article-title">CLOS</div><div id="article">The <b>C</b>ommon <b>L</b>isp <b>O</b>bject <b>S</b>ystem is based on generic functions, multiple inheritance, and declarative method combination. Many implementations also have a meta-object protocol, or <a href="MOP.html" class="internal">MOP</a>, often based on that described in <a href="AMOP.html" class="internal">AMOP</a><p>Any purporting-to-conform <a href="ANSI.html" class="internal">ANSI</a> CL implementation will have CLOS built in. There are also "add-on" implementations from before it was part of standard CL: <a href="Closette.html" class="internal">Closette</a> is the code developed in the <a href="AMOP.html" class="internal">AMOP</a> book and probably not practically useful, whereas <a href="PCL.html" class="internal">PCL</a> is fully-featured (if slower than a typical tuned commercial implementation might be) and has been used as the basis for the CLOS support in e.g. <a href="CMUCL.html" class="internal">CMUCL</a> and <a href="SBCL.html" class="internal">SBCL</a><p>Web pages:<p><ul>
<li>Marty Hall's Introduction to the Common Lisp Object System can be found <a href="http://web.archive.org/web/20060110172133/http://www.apl.jhu.edu/~hall/AI-Programming/CLOS.html">here</a>
</li>
<li>
<a href="http://web.archive.org/web/20020209082455/http://www.cs.caltech.edu/~cs20/refs/lisp-CLOS.html">This page</a> describes the bare essentials of CLOS. It's from James Arvo's Caltech CS class.</li>
<li>
<a href="https://www.algo.be/cl/documents/clos-guide.html">A Brief Guide to CLOS</a> by Jeff Dalton.</li>
<li>Tae-Sun Chung's <a href="http://web.archive.org/web/20030818204121/http://oopsla.snu.ac.kr/clos/clos/frame.html">CLOS Overview</a>
</li>
<li>CLOS <a href="https://dreamsongs.com/CLOS.html">overview and concept papers</a> on <a href="https://dreamsongs.com/">Richard P. Gabriel's</a> site.
</li>
<li>
<a href="http://web.archive.org/web/20100616074959/http://cs.christophwernhard.com/cdb/">CLOS-DB</a> is a <a href="database.html" class="internal">database</a> interface for the Common Lisp Object System.</li>
</ul><p>Topic listing:<p><ul>
<li>
<a href="change-class&#32;dangers.html" class="internal">change-class dangers</a> -
<a href="https://www.cliki.net/site/HyperSpec/Body/stagenfun_change-class.html" class="hyperspec">change-class</a> changes the class of the <a href="CLOS.html" class="category">CLOS</a> object involved; in
</li>
<li>
<a href="cl-mop.html" class="internal">cl-mop</a> -
Basic tools to make dealing with CLOS easier and portable
</li>
<li>
<a href="clos-diff.html" class="internal">clos-diff</a> -
clos-diff is a library to create and apply diffs of <a href="CLOS.html" class="category">CLOS</a> objects in a compact representation
</li>
<li>
<a href="Closer&#32;to&#32;MOP.html" class="internal">Closer to MOP</a> -
Closer to MOP is a compatibility layer that rectifies many of the absent or incorrect <a href="MOP.html" class="category">MOP</a> features as detected by <a href="MOP-features.html" class="internal">MOP Feature Tests</a>
</li>
<li>
<a href="Closette.html" class="internal">Closette</a> -
A working Closette package (with <a href="ASDF.html" class="internal">ASDF</a> definitions) can be found on <a href="https://github.com/binghe/closette">Github</a>, it can be compiled and loaded in almost every CL implementation
</li>
<li>
<a href="clutter.html" class="internal">clutter</a> -
Annotations/decorators/attributes for <a href="CLOS.html" class="category">CLOS</a> classes and slots
</li>
<li>
<a href="Filtered&#32;Functions.html" class="internal">Filtered Functions</a> -
filtered-functions implements arbitrary predicate dispatch for <a href="CLOS.html" class="category">CLOS</a>
</li>
<li>
<a href="method-versions.html" class="internal">method-versions</a> -
A Common Lisp library for dispatching generic methods based on the value of a global parameter rather than on one of the required parameters
</li>
<li>
<a href="MOP.html" class="internal">MOP</a> -
Meta Object Protocol(MOP) is a protocol for describing <a href="CLOS.html" class="category">CLOS</a> itself as an extensible CLOS program
</li>
<li>
<a href="MOP-standards-discussion.html" class="internal">MOP-standards-discussion</a> -
The <a href="MOP.html" class="category">MOP</a> is great, but nothing is perfect
</li>
<li>
<a href="Portable&#32;CommonLoops.html" class="internal">Portable CommonLoops</a> -
<a href="https://github.com/binghe/PCL">Portable CommonLoops</a> is a reference <a href="CLOS.html" class="category">CLOS</a>/<a href="MOP.html" class="category">MOP</a> implementation originally developed by Xerox, deriving from the <a href="https://larrymasinter.net/stefik-loops.pdf">Loops Project</a>
</li>
<li>
<a href="wrapping-standard.html" class="internal">wrapping-standard</a> -
Like the <a href="https://www.cliki.net/site/HyperSpec/Body/sec_7-6-6-2.html">standard method combination</a> but :wrapping methods get called in :most-specific-last order (and outside :around methods): <a href="https://github.com/tfeb/tfeb-lisp-hax/blob/main/wrapping-standard.lisp">wrapping-standard.lisp</a>
</li>
</ul>
<h4>See also</h4>
<ul>
<li>
<a href="https://github.com/EuAndreh/defclass-std">defclass-std</a> is a shortcut macro to write <a href="https://www.cliki.net/site/HyperSpec/Body/mac_defclass.html" class="hyperspec">DEFCLASS</a> forms quickly (in <a href="Quicklisp.html" class="internal">Quicklisp</a>). For example, the following
</li>
</ul>
<div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><i><span class="symbol">defclass/std</span></i> example <span class="paren2">(<span class="nonparen"></span>)</span>
<span class="paren2">(<span class="nonparen"><span class="paren3">(<span class="nonparen">slot1 slot2 slot3</span>)</span></span>)</span></span>)</span>
</span></div><p>expands to<p><div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/mac_defclass.html" class="symbol"><i><span class="symbol">DEFCLASS</span></i></a> EXAMPLE <span class="paren2">(<span class="nonparen"></span>)</span>
<span class="paren2">(<span class="nonparen"><span class="paren3">(<span class="nonparen">SLOT1 <span class="keyword">:ACCESSOR</span> SLOT1 <span class="keyword">:INITARG</span> <span class="keyword">:SLOT1</span> <span class="keyword">:INITFORM</span> <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="symbol">NIL</a></span>)</span>
<span class="paren3">(<span class="nonparen">SLOT2 <span class="keyword">:ACCESSOR</span> SLOT2 <span class="keyword">:INITARG</span> <span class="keyword">:SLOT2</span> <span class="keyword">:INITFORM</span> <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="symbol">NIL</a></span>)</span>
<span class="paren3">(<span class="nonparen">SLOT3 <span class="keyword">:ACCESSOR</span> SLOT3 <span class="keyword">:INITARG</span> <span class="keyword">:SLOT3</span> <span class="keyword">:INITFORM</span> <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="symbol">NIL</a></span>)</span></span>)</span></span>)</span>
</span></div><p>It is very flexible. The repository contains examples from other projects (<a href="Clack.html" class="internal">Clack</a>, etc).</div></div>
<div id="footer" class="buttonbar"><ul><li><a href="CLOS.html">Current version</a></li>
<li><a href="https://www.cliki.net/site/history?article=CLOS">History</a></li>
<li><a href="https://www.cliki.net/site/backlinks?article=CLOS">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=CLOS&amp;from-revision=3836341606">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
</div>
<div id="header-buttons" class="buttonbar">
<ul>
<li><a href="https://www.cliki.net/">Home</a></li>
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
<li><a href="CLiki.html">About</a></li>
<li><a href="Text&#32;Formatting.html">Text Formatting</a></li>
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
</ul>
<div id="search">
<form action="https://www.cliki.net/site/search">
<label for="search_query" class="hidden">Search CLiki</label>
<input type="text" name="query" id="search_query" value="" />
<input type="submit" value="search" />
</form>
</div>
</div>
<div id="pageheader">
<div id="header">
<span id="logo">CLiki</span>
<span id="slogan">the common lisp wiki</span>
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
<label for="login_name" class="hidden">Account name</label>
<input type="text" name="name" id="login_name" class="login_input" />
<label for= "login_password" class="hidden">Password</label>
<input type="password" name="password" id="login_password" class="login_input" />
<input type="submit" name="login" value="login" id="login_submit" /><br />
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
</form>
</div>
</div>
</div>
</body></html>