r8112: convert from entities chapters to xinclude
[uffi.git] / doc / ref_declare.xml
1 <?xml version='1.0' ?>   <!-- Mode: Docbook --> 
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3                "file:///usr/share/sgml/docbook/dtd/xml/4.2/docbookx.dtd" [
4 <!ENTITY % myents SYSTEM "entities.xml">
5 %myents;
6 ]>
7   
8 <reference id="ref_declarations">
9   <title>Declarations</title>
10
11   <partintro>
12     <sect1>
13       <title>Overview</title>
14       <para>Declarations are used to give the compiler optimizing
15         information about foreign types. Currently, only &cmucl;
16         supports declarations. On &acl; and &lw;, these expressions 
17         declare the type generically as &t;
18       </para>
19     </sect1>
20   </partintro>
21
22       <refentry id="def-type">
23         <refnamediv>
24           <refname>def-type</refname>
25         <refpurpose>Defines a Common Lisp type. 
26         </refpurpose>
27         <refclass>Macro</refclass>
28       </refnamediv>
29       <refsynopsisdiv>
30         <title>Syntax</title>
31         <synopsis>
32           <function>def-type</function> <replaceable>name type</replaceable>
33         </synopsis>
34       </refsynopsisdiv>
35       <refsect1>
36         <title>Arguments and Values</title>
37         <variablelist>
38           <varlistentry>
39             <term><parameter>name</parameter></term>
40             <listitem>
41               <para>A symbol naming the type</para>
42             </listitem>
43           </varlistentry>
44           <varlistentry>
45             <term><parameter>type</parameter></term>
46             <listitem>
47               <para>A form that is evaluated that specifies the &uffi; type.
48               </para>
49             </listitem>
50           </varlistentry>
51         </variablelist>
52       </refsect1>
53       <refsect1>
54         <title>Description</title>
55         <para>Defines a Common Lisp type based on a &uffi; type.
56         </para>
57       </refsect1>
58       <refsect1>
59         <title>Examples</title>
60         <programlisting>
61 (def-type char-ptr '(* :char))
62 ...
63 (defun foo (ptr)
64   (declare (type char-ptr ptr))
65   ...
66         </programlisting>
67       </refsect1>
68       <refsect1>
69         <title>Side Effects</title>
70         <para>Defines a new &cl; type.</para>
71       </refsect1>
72       <refsect1>
73         <title>Affected by</title>
74         <para>None.</para>
75       </refsect1>
76       <refsect1>
77         <title>Exceptional Situations</title>
78         <para>None.</para>
79       </refsect1>
80     </refentry>
81   </reference>
82