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

« back to all changes in this revision

Viewing changes to info/iteration.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 Iteration and Tests, User Interface, Structures, Top
 
2
@chapter Iteration and Tests
 
3
 
 
4
@deffn {Macro} DO-EXTERNAL-SYMBOLS 
 
5
Package:LISP
 
6
 
 
7
Syntax:
 
8
@example
 
9
(do-external-symbols (var [package [result-form]])
 
10
          @{decl@}* @{tag | statement@}*)
 
11
@end example
 
12
 
 
13
Executes STATEMENTs once for each external symbol in the PACKAGE (which
 
14
defaults to the current package), with VAR bound to the current symbol.
 
15
Then evaluates RESULT-FORM (which defaults to NIL) and returns the value(s).
 
16
 
 
17
 
 
18
@end deffn
 
19
 
 
20
@deffn {Special Form} DO* 
 
21
Package:LISP
 
22
 
 
23
Syntax:
 
24
@example
 
25
(do* (@{(var [init [step]])@}*) (endtest @{result@}*)
 
26
          @{decl@}* @{tag | statement@}*)
 
27
@end example
 
28
 
 
29
Just like DO, but performs variable bindings and assignments in serial, just
 
30
like LET* and SETQ do.
 
31
 
 
32
 
 
33
@end deffn
 
34
 
 
35
@deffn {Macro} DO-ALL-SYMBOLS 
 
36
Package:LISP
 
37
 
 
38
Syntax:
 
39
@example
 
40
(do-all-symbols (var [result-form]) @{decl@}* @{tag | statement@}*)
 
41
@end example
 
42
 
 
43
Executes STATEMENTs once for each symbol in each package, with VAR bound to
 
44
the current symbol.  Then evaluates RESULT-FORM (which defaults to NIL) and
 
45
returns the value(s).
 
46
 
 
47
 
 
48
@end deffn
 
49
 
 
50
@defun YES-OR-NO-P (&optional (format-string nil) &rest args)
 
51
Package:LISP
 
52
 
 
53
Asks the user a question whose answer is either 'YES' or 'NO'.  If FORMAT-
 
54
STRING is non-NIL, then FRESH-LINE operation is performed, a message is
 
55
printed as if FORMAT-STRING and ARGs were given to FORMAT, and then a prompt
 
56
"(Yes or No)" is printed.  Otherwise, no prompt will appear.
 
57
 
 
58
 
 
59
@end defun
 
60
 
 
61
@defun MAPHASH #'hash-table
 
62
Package:LISP
 
63
 
 
64
For each entry in HASH-TABLE, calls FUNCTION on the key and value of the
 
65
entry; returns NIL.
 
66
 
 
67
 
 
68
@end defun
 
69
 
 
70
@defun MAPCAR (fun list &rest more-lists)
 
71
Package:LISP
 
72
 
 
73
Applies FUN to successive cars of LISTs and returns the results as a list.
 
74
 
 
75
 
 
76
@end defun
 
77
 
 
78
@deffn {Special Form} DOLIST 
 
79
Package:LISP
 
80
 
 
81
Syntax:
 
82
@example
 
83
(dolist (var listform [result]) @{decl@}* @{tag | statement@}*)
 
84
@end example
 
85
 
 
86
Executes STATEMENTs, with VAR bound to each member of the list value of
 
87
LISTFORM.  Then returns the value(s) of RESULT (which defaults to NIL).
 
88
 
 
89
 
 
90
@end deffn
 
91
 
 
92
@defun EQ (x y)
 
93
Package:LISP
 
94
 
 
95
Returns T if X and Y are the same identical object; NIL otherwise.
 
96
 
 
97
 
 
98
@end defun
 
99
 
 
100
@defun EQUALP (x y)
 
101
Package:LISP
 
102
 
 
103
Returns T if X and Y are EQUAL, if they are characters and satisfy CHAR-EQUAL,
 
104
if they are numbers and have the same numerical value, or if they have
 
105
components that are all EQUALP.  Returns NIL otherwise.
 
106
 
 
107
 
 
108
@end defun
 
109
 
 
110
@defun EQUAL (x y)
 
111
Package:LISP
 
112
 
 
113
Returns T if X and Y are EQL or if they are of the same type and corresponding
 
114
components are EQUAL.  Returns NIL otherwise.  Strings and bit-vectors are
 
115
EQUAL if they are the same length and have identical components.  Other
 
116
arrays must be EQ to be EQUAL.
 
117
 
 
118
 
 
119
@end defun
 
120
 
 
121
@deffn {Macro} DO-SYMBOLS 
 
122
Package:LISP
 
123
 
 
124
Syntax:
 
125
@example
 
126
(do-symbols (var [package [result-form]]) @{decl@}* @{tag |
 
127
statement@}*)
 
128
@end example
 
129
 
 
130
Executes STATEMENTs once for each symbol in the PACKAGE (which defaults to
 
131
the current package), with VAR bound to the current symbol.  Then evaluates
 
132
RESULT-FORM (which defaults to NIL) and returns the value(s).
 
133
 
 
134
 
 
135
@end deffn
 
136
 
 
137
@deffn {Special Form} LOOP 
 
138
Package:LISP
 
139
 
 
140
Syntax:
 
141
@example
 
142
(loop @{form@}*)
 
143
@end example
 
144
 
 
145
Executes FORMs repeatedly until exited by a THROW or RETURN.  The FORMs are
 
146
surrounded by an implicit NIL block.
 
147
 
 
148
 
 
149
@end deffn