65 lines
3.1 KiB
HTML
65 lines
3.1 KiB
HTML
<html lang="en">
|
|
<head>
|
|
<title>Overview of Funcallable Instances - SBCL Internals</title>
|
|
<meta http-equiv="Content-Type" content="text/html">
|
|
<meta name="description" content="SBCL Internals">
|
|
<meta name="generator" content="makeinfo 4.11">
|
|
<link title="Top" rel="start" href="index.html#Top">
|
|
<link rel="up" href="Funcallable-Instances.html#Funcallable-Instances" title="Funcallable Instances">
|
|
<link rel="next" href="Implementation-of-Funcallable-Instances.html#Implementation-of-Funcallable-Instances" title="Implementation of Funcallable Instances">
|
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
|
<!--
|
|
|
|
This manual is part of the SBCL software system. See the `README'
|
|
file for more information.
|
|
|
|
This manual is in the public domain and is provided with
|
|
absolutely no warranty. See the `COPYING' and `CREDITS' files for
|
|
more information.
|
|
-->
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
<style type="text/css"><!--
|
|
pre.display { font-family:inherit }
|
|
pre.format { font-family:inherit }
|
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
|
pre.smallexample { font-size:smaller }
|
|
pre.smalllisp { font-size:smaller }
|
|
span.sc { font-variant:small-caps }
|
|
span.roman { font-family:serif; font-weight:normal; }
|
|
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
<div class="node">
|
|
<p>
|
|
<a name="Overview-of-Funcallable-Instances"></a>
|
|
Next: <a rel="next" accesskey="n" href="Implementation-of-Funcallable-Instances.html#Implementation-of-Funcallable-Instances">Implementation of Funcallable Instances</a>,
|
|
Up: <a rel="up" accesskey="u" href="Funcallable-Instances.html#Funcallable-Instances">Funcallable Instances</a>
|
|
<hr>
|
|
</div>
|
|
|
|
<h3 class="section">5.1 Overview of Funcallable Instances</h3>
|
|
|
|
<p>Funcallable instances in SBCL are implemented as a subtype of
|
|
<code>function</code>, and as such must be directly funcallable using the same
|
|
calling sequence as ordinary functions and closure objects, which means
|
|
reading the first word of the object after the header, and then jumping
|
|
to it (with an offset on non-x86 platforms). It must be possible to set
|
|
the function of a funcallable instance, as CLOS (one user of funcallable
|
|
instances) computes and sets the discriminating function for generic
|
|
functions with <code>sb-mop:set-funcallable-instance-function</code>, and also
|
|
allows the user to do the same.
|
|
|
|
<p>Additionally, although this functionality is not exported to the normal
|
|
user, they must support an arbitrary number of slots definable with
|
|
<code>!defstruct-with-alternate-metaclass</code>. If generic functions were
|
|
the only users of funcallable instances, then this might be less
|
|
critical, but (as of SBCL 0.9.17) other users of funcallable instances
|
|
are: the <code>ctor</code> make-instance optimization; the
|
|
<code>method-function</code> funcallable instance which does the bookkeeping
|
|
for fast method function optimization; and interpreted functions in the
|
|
full evaluator.
|
|
|
|
</body></html>
|
|
|