| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE book [ |
| 3 |
<!ENTITY % eclent SYSTEM "../ecl.ent"> |
| 4 |
%eclent; |
| 5 |
]> |
| 6 |
<book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en"> |
| 7 |
<reference xml:id="uffi.ref_declarations"> |
| 8 |
<title>Declarations</title> |
| 9 |
|
| 10 |
<partintro> |
| 11 |
<sect1> |
| 12 |
<title>Overview</title> |
| 13 |
<para>Declarations are used to give the compiler optimizing |
| 14 |
information about foreign types. Currently, only &CMUCL; |
| 15 |
supports declarations. On &ACL; and &LW;, these expressions |
| 16 |
declare the type generically as &t; |
| 17 |
</para> |
| 18 |
</sect1> |
| 19 |
</partintro> |
| 20 |
|
| 21 |
<refentry xml:id="uffi.def-type"> |
| 22 |
<refnamediv> |
| 23 |
<refname>def-type</refname> |
| 24 |
<refpurpose>Defines a Common Lisp type. |
| 25 |
</refpurpose> |
| 26 |
<refclass>Macro</refclass> |
| 27 |
</refnamediv> |
| 28 |
<refsynopsisdiv> |
| 29 |
<title>Syntax</title> |
| 30 |
<synopsis> |
| 31 |
<function>def-type</function> <replaceable>name type</replaceable> |
| 32 |
</synopsis> |
| 33 |
<variablelist> |
| 34 |
<varlistentry> |
| 35 |
<term><parameter>name</parameter></term> |
| 36 |
<listitem> |
| 37 |
<para>A symbol naming the type</para> |
| 38 |
</listitem> |
| 39 |
</varlistentry> |
| 40 |
<varlistentry> |
| 41 |
<term><parameter>type</parameter></term> |
| 42 |
<listitem> |
| 43 |
<para>A form that specifies the &UFFI; type. It is not evaluated. |
| 44 |
</para> |
| 45 |
</listitem> |
| 46 |
</varlistentry> |
| 47 |
</variablelist> |
| 48 |
</refsynopsisdiv> |
| 49 |
<refsect1> |
| 50 |
<title>Description</title> |
| 51 |
<para>Defines a Common Lisp type based on a &UFFI; type. |
| 52 |
</para> |
| 53 |
</refsect1> |
| 54 |
<refsect1> |
| 55 |
<title>Examples</title> |
| 56 |
<screen> |
| 57 |
(def-type char-ptr '(* :char)) |
| 58 |
... |
| 59 |
(defun foo (ptr) |
| 60 |
(declare (type char-ptr ptr)) |
| 61 |
... |
| 62 |
</screen> |
| 63 |
</refsect1> |
| 64 |
<refsect1> |
| 65 |
<title>Side Effects</title> |
| 66 |
<para>Defines a new &CommonLisp; type.</para> |
| 67 |
</refsect1> |
| 68 |
<refsect1> |
| 69 |
<title>Affected by</title> |
| 70 |
<para>None.</para> |
| 71 |
</refsect1> |
| 72 |
<refsect1> |
| 73 |
<title>Exceptional Situations</title> |
| 74 |
<para>None.</para> |
| 75 |
</refsect1> |
| 76 |
</refentry> |
| 77 |
</reference> |
| 78 |
</book> |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|