File: ref_declare.xml

package info (click to toggle)
cl-uffi 1.4.37-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 708 kB
  • ctags: 378
  • sloc: lisp: 3,408; xml: 2,889; makefile: 229; ansic: 169; sh: 74
file content (82 lines) | stat: -rw-r--r-- 2,087 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % myents SYSTEM "entities.inc">
%myents;
]>
  
<reference id="ref_declarations">
  <title>Declarations</title>
  
  <partintro>
    <sect1>
      <title>Overview</title>
      <para>Declarations are used to give the compiler optimizing
	information about foreign types. Currently, only &cmucl;
	supports declarations. On &acl; and &lw;, these expressions 
	declare the type generically as &t;
      </para>
    </sect1>
  </partintro>

  <refentry id="def-type">
    <refnamediv>
      <refname>def-type</refname>
      <refpurpose>Defines a Common Lisp type. 
      </refpurpose>
      <refclass>Macro</refclass>
    </refnamediv>
    <refsynopsisdiv>
      <title>Syntax</title>
      <synopsis>
	<function>def-type</function> <replaceable>name type</replaceable>
      </synopsis>
    </refsynopsisdiv>
    <refsect1>
      <title>Arguments and Values</title>
      <variablelist>
	<varlistentry>
	  <term><parameter>name</parameter></term>
	  <listitem>
	    <para>A symbol naming the type</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>type</parameter></term>
	  <listitem>
	    <para>A form that specifies the &uffi; type. It is not evaluated.
	    </para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </refsect1>
    <refsect1>
      <title>Description</title>
      <para>Defines a Common Lisp type based on a &uffi; type.
      </para>
    </refsect1>
    <refsect1>
      <title>Examples</title>
      <screen>
(def-type char-ptr '(* :char))
...
(defun foo (ptr)
(declare (type char-ptr ptr))
...
      </screen>
    </refsect1>
    <refsect1>
      <title>Side Effects</title>
      <para>Defines a new &cl; type.</para>
    </refsect1>
    <refsect1>
      <title>Affected by</title>
      <para>None.</para>
    </refsect1>
    <refsect1>
      <title>Exceptional Situations</title>
      <para>None.</para>
    </refsect1>
  </refentry>
</reference>