~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to info/type.texi

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@node Type, GCL Specific, Doc, Top
 
2
@chapter Type
 
3
 
 
4
@defun COERCE (x type)
 
5
Package:LISP
 
6
 
 
7
Coerces X to an object of the type TYPE.
 
8
 
 
9
 
 
10
@end defun
 
11
 
 
12
@defun TYPE-OF (x)
 
13
Package:LISP
 
14
 
 
15
Returns the type of X.
 
16
 
 
17
 
 
18
@end defun
 
19
 
 
20
@defun CONSTANTP (symbol)
 
21
Package:LISP
 
22
 
 
23
Returns T if the variable named by SYMBOL is a constant; NIL otherwise.
 
24
 
 
25
 
 
26
@end defun
 
27
 
 
28
@defun TYPEP (x type)
 
29
Package:LISP
 
30
 
 
31
Returns T if X is of the type TYPE; NIL otherwise.
 
32
 
 
33
 
 
34
@end defun
 
35
 
 
36
@defun COMMONP (x)
 
37
Package:LISP
 
38
 
 
39
Returns T if X is a Common Lisp object; NIL otherwise.
 
40
 
 
41
 
 
42
@end defun
 
43
 
 
44
@defun SUBTYPEP (type1 type2)
 
45
Package:LISP
 
46
 
 
47
Returns T if TYPE1 is a subtype of TYPE2; NIL otherwise.  If it could not
 
48
determine, then returns NIL as the second value.  Otherwise, the second value
 
49
is T.
 
50
 
 
51
 
 
52
@end defun
 
53
 
 
54
@deffn {Macro} CHECK-TYPE 
 
55
Package:LISP
 
56
 
 
57
Syntax:
 
58
@example
 
59
(check-type place typespec [string])
 
60
@end example
 
61
 
 
62
Signals an error, if the contents of PLACE are not of the specified type.
 
63
 
 
64
 
 
65
@end deffn
 
66
 
 
67
@deffn {Macro} ASSERT 
 
68
Package:LISP
 
69
 
 
70
Syntax:
 
71
@example
 
72
(assert test-form [(@{place@}*) [string @{arg@}*]])
 
73
@end example
 
74
 
 
75
Signals an error if the value of TEST-FORM is NIL.  STRING is an format string
 
76
used as the error message.  ARGs are arguments to the format string.
 
77
 
 
78
 
 
79
@end deffn
 
80
 
 
81
@deffn {Macro} DEFTYPE 
 
82
Package:LISP
 
83
 
 
84
Syntax:
 
85
@example
 
86
(deftype name lambda-list @{decl | doc@}* @{form@}*)
 
87
@end example
 
88
 
 
89
Defines a new type-specifier abbreviation in terms of an 'expansion' function
 
90
        (lambda lambda-list1 @{decl@}* @{form@}*)
 
91
where lambda-list1 is identical to LAMBDA-LIST except that all optional
 
92
parameters with no default value specified in LAMBDA-LIST defaults to the
 
93
symbol '*', but not to NIL.  When the type system of GCL encounters a
 
94
type specifier (NAME arg1 ... argn), it calls the expansion function with
 
95
the arguments arg1 ... argn, and uses the returned value instead of the
 
96
original type specifier.  When the symbol NAME is used as a type specifier,
 
97
the expansion function is called with no argument.  The doc-string DOC, if
 
98
supplied, is saved as the TYPE doc of NAME, and is retrieved by
 
99
(documentation 'NAME 'type).
 
100
 
 
101
 
 
102
@end deffn
 
103
 
 
104
@defvr {Declaration} DYNAMIC-EXTENT 
 
105
Package:LISP
 
106
Declaration to allow locals to be cons'd on the C stack.
 
107
For example
 
108
(defun foo (&rest l) (declare (:dynamic-extent l)) ...)
 
109
will cause l to be a list formed on the C stack of the foo function
 
110
frame.
 
111
Of course passing L out as a value of foo will cause havoc.
 
112
(setq x (make-list n))
 
113
(setq x (cons a b))
 
114
(setq x (list a  b c ..))
 
115
also are handled on the stack, for dynamic-extent x.
 
116
 
 
117
 
 
118
 
 
119
@end defvr