Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 382

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>def-enum</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="rn02.html" title="Aggregate Types"><link rel="prev" href="rn02.html" title="Aggregate Types"><link rel="next" href="rn02re50.html" title="def-struct"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><code class="function">def-enum</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rn02.html">Prev</a>&#160;</td><th width="60%" align="center">Aggregate Types</th><td width="20%" align="right">&#160;<a accesskey="n" href="rn02re50.html">Next</a></td></tr></table><hr></div><div class="refentry" title="def-enum"><a name="uffi.def-enum"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p><code class="function">def-enum</code> &#8212; Defines a <acronym class="acronym">C</acronym> enumeration.
    <b>Macro</b></p></div><div class="refsynopsisdiv" title="Syntax"><h2>Syntax</h2><pre class="synopsis">
     <code class="function">def-enum</code> <em class="replaceable"><code>name fields &amp;key separator-string</code></em>
    </pre></div><div class="refsect1" title="Arguments and Values"><a name="id686886"></a><h2>Arguments and Values</h2><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>name</code></em></span></p></td><td><p>A symbol that names the enumeration.
       </p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>fields</code></em></span></p></td><td><p>A list of field defintions. Each definition can be
       a symbol or a list of two elements. Symbols get assigned a value of the
       current counter which starts at <code class="computeroutput">0</code> and
       increments by <code class="computeroutput">1</code> for each subsequent symbol. It the field definition is a list, the first position is the symbol and the second
       position is the value to assign the the symbol. The current counter gets set
       to <code class="computeroutput">1+</code> this value.
       </p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>separator-string</code></em></span></p></td><td><p>A string that governs the creation of constants. The
       default is <code class="computeroutput">"#"</code>.</p></td></tr></tbody></table></div></div><div class="refsect1" title="Description"><a name="id686973"></a><h2>Description</h2><p>
     Declares a <acronym class="acronym">C</acronym> enumeration. It generates constants with integer values for the elements of the enumeration. The symbols for the these constant
     values are created by the <code class="function">concatenation</code> of the
     enumeration name, separator-string, and field symbol. Also creates
     a foreign type with the name <em class="parameter"><code>name</code></em> of type
     <code class="constant">:int</code>.
    </p></div><div class="refsect1" title="Examples"><a name="id687004"></a><h2>Examples</h2><pre class="screen">
(def-enum abc (:a :b :c)) 
;; Creates constants abc#a (1), abc#b (2), abc#c (3) and defines
;; the foreign type "abc" to be :int

(def-enum efoo (:e1 (:e2 10) :e3) :separator-string "-")
;; Creates constants efoo-e1 (1), efoo-e2 (10), efoo-e3 (11) and defines
;; the foreign type efoo to be :int</pre></div><div class="refsect1" title="Side Effects"><a name="id687019"></a><h2>Side Effects</h2><p>Creates a :int foreign type, defines constants.</p></div><div class="refsect1" title="Affected by"><a name="id687029"></a><h2>Affected by</h2><p>None.</p></div><div class="refsect1" title="Exceptional Situations"><a name="id687040"></a><h2>Exceptional Situations</h2><p>None.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rn02.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="rn02.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="rn02re50.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Aggregate Types&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<code class="function">def-struct</code></td></tr></table></div></body></html>