151 lines
11 KiB
HTML
151 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<!-- This manual documents Guile version 3.0.10.
|
|
|
|
Copyright (C) 1996-1997, 2000-2005, 2009-2023 Free Software Foundation,
|
|
Inc.
|
|
|
|
Copyright (C) 2021 Maxime Devos
|
|
|
|
Copyright (C) 2024 Tomas Volf
|
|
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
|
any later version published by the Free Software Foundation; with no
|
|
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
|
|
copy of the license is included in the section entitled "GNU Free
|
|
Documentation License." -->
|
|
<title>Slots (Guile Reference Manual)</title>
|
|
|
|
<meta name="description" content="Slots (Guile Reference Manual)">
|
|
<meta name="keywords" content="Slots (Guile Reference Manual)">
|
|
<meta name="resource-type" content="document">
|
|
<meta name="distribution" content="global">
|
|
<meta name="Generator" content=".texi2any-real">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<link href="index.html" rel="start" title="Top">
|
|
<link href="Concept-Index.html" rel="index" title="Concept Index">
|
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
|
<link href="Introspection.html" rel="up" title="Introspection">
|
|
<link href="Generic-Functions.html" rel="next" title="Generic Functions">
|
|
<link href="Instances.html" rel="prev" title="Instances">
|
|
<style type="text/css">
|
|
<!--
|
|
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
|
span:hover a.copiable-link {visibility: visible}
|
|
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
|
|
-->
|
|
</style>
|
|
<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css">
|
|
|
|
|
|
</head>
|
|
|
|
<body lang="en">
|
|
<div class="subsection-level-extent" id="Slots">
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Generic-Functions.html" accesskey="n" rel="next">Generic Functions</a>, Previous: <a href="Instances.html" accesskey="p" rel="prev">Instances</a>, Up: <a href="Introspection.html" accesskey="u" rel="up">Introspection</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
<hr>
|
|
<h4 class="subsection" id="Slots-1"><span>8.8.3 Slots<a class="copiable-link" href="#Slots-1"> ¶</a></span></h4>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-class_002dslot_002ddefinition"><span class="category-def">procedure: </span><span><strong class="def-name">class-slot-definition</strong> <var class="def-var-arguments">class slot-name</var><a class="copiable-link" href="#index-class_002dslot_002ddefinition"> ¶</a></span></dt>
|
|
<dd><p>Return the slot definition for the slot named <var class="var">slot-name</var> in class
|
|
<var class="var">class</var>. <var class="var">slot-name</var> should be a symbol.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dname"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-name</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dname"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot name from <var class="var">slot-def</var>.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002doptions"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-options</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002doptions"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot options from <var class="var">slot-def</var>.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dallocation"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-allocation</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dallocation"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot allocation option from <var class="var">slot-def</var>. This
|
|
is the value of the <code class="code">#:allocation</code> keyword (see <a class="pxref" href="Slot-Options.html">allocation</a>), or <code class="code">#:instance</code> if the <code class="code">#:allocation</code> keyword is
|
|
absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dgetter"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-getter</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dgetter"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot getter option from <var class="var">slot-def</var>. This is
|
|
the value of the <code class="code">#:getter</code> keyword (see <a class="pxref" href="Slot-Options.html">getter</a>), or <code class="code">#f</code> if the <code class="code">#:getter</code> keyword is absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dsetter"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-setter</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dsetter"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot setter option from <var class="var">slot-def</var>. This is
|
|
the value of the <code class="code">#:setter</code> keyword (see <a class="pxref" href="Slot-Options.html">setter</a>), or <code class="code">#f</code> if the <code class="code">#:setter</code> keyword is absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002daccessor"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-accessor</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002daccessor"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot accessor option from <var class="var">slot-def</var>. This
|
|
is the value of the <code class="code">#:accessor</code> keyword (see <a class="pxref" href="Slot-Options.html">accessor</a>), or <code class="code">#f</code> if the <code class="code">#:accessor</code> keyword is absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dinit_002dvalue"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-init-value</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dinit_002dvalue"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot init-value option from <var class="var">slot-def</var>. This
|
|
is the value of the <code class="code">#:init-value</code> keyword (see <a class="pxref" href="Slot-Options.html">init-value</a>), or the unbound value if the <code class="code">#:init-value</code> keyword is
|
|
absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dinit_002dform"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-init-form</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dinit_002dform"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot init-form option from <var class="var">slot-def</var>. This
|
|
is the value of the <code class="code">#:init-form</code> keyword (see <a class="pxref" href="Slot-Options.html">init-form</a>), or the unbound value if the <code class="code">#:init-form</code> keyword is
|
|
absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dinit_002dthunk"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-init-thunk</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dinit_002dthunk"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot init-thunk option from <var class="var">slot-def</var>. This
|
|
is the value of the <code class="code">#:init-thunk</code> keyword (see <a class="pxref" href="Slot-Options.html">init-thunk</a>), or <code class="code">#f</code> if the <code class="code">#:init-thunk</code> keyword is absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002ddefinition_002dinit_002dkeyword"><span class="category-def">procedure: </span><span><strong class="def-name">slot-definition-init-keyword</strong> <var class="def-var-arguments">slot-def</var><a class="copiable-link" href="#index-slot_002ddefinition_002dinit_002dkeyword"> ¶</a></span></dt>
|
|
<dd><p>Extract and return the slot init-keyword option from <var class="var">slot-def</var>.
|
|
This is the value of the <code class="code">#:init-keyword</code> keyword (see <a class="pxref" href="Slot-Options.html">init-keyword</a>), or <code class="code">#f</code> if the <code class="code">#:init-keyword</code>
|
|
keyword is absent.
|
|
</p></dd></dl>
|
|
|
|
<dl class="first-deffn">
|
|
<dt class="deffn" id="index-slot_002dinit_002dfunction"><span class="category-def">procedure: </span><span><strong class="def-name">slot-init-function</strong> <var class="def-var-arguments">class slot-name</var><a class="copiable-link" href="#index-slot_002dinit_002dfunction"> ¶</a></span></dt>
|
|
<dd><p>Return the initialization function for the slot named <var class="var">slot-name</var> in
|
|
class <var class="var">class</var>. <var class="var">slot-name</var> should be a symbol.
|
|
</p>
|
|
<p>The returned initialization function incorporates the effects of the
|
|
standard <code class="code">#:init-thunk</code>, <code class="code">#:init-form</code> and <code class="code">#:init-value</code>
|
|
slot options. These initializations can be overridden by the
|
|
<code class="code">#:init-keyword</code> slot option or by a specialized <code class="code">initialize</code>
|
|
method, so, in general, the function returned by
|
|
<code class="code">slot-init-function</code> may be irrelevant. For a fuller discussion,
|
|
see <a class="ref" href="Slot-Options.html">init-value</a>.
|
|
</p></dd></dl>
|
|
|
|
|
|
</div>
|
|
<hr>
|
|
<div class="nav-panel">
|
|
<p>
|
|
Next: <a href="Generic-Functions.html">Generic Functions</a>, Previous: <a href="Instances.html">Instances</a>, Up: <a href="Introspection.html">Introspection</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|