-
Notifications
You must be signed in to change notification settings - Fork 2
/
pcl.notes
225 lines (194 loc) · 2.85 KB
/
pcl.notes
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
1 Practical: A Simple Database
list
getf
defun
defvar
push
dolist
format
read-line
force-output
parse-integer
or
y-or-n-p
loop
return
with-open-file
print
with-standard-io-syntax
read
setf
remove-if-not
evenp
lambda
equal
mapcar
defmacro
reverse
and
macroexpand-1
2 Syntax and Semantics
if
quote
compile-file
load
*some notes on equality:
eq -"object identity" two objects are EQ if they are identical
-however, regarding numbers and characters, this is dependent
-upon the implementation: (eq 3 3) can legally be true or false
eql -behaves like eq, but guarantees two objects of the same class
-representing the same numeric or character value are eql
-so (eql 1 1) is true, but (eql 1 1.0) is not
equal -considers lists with the same structure and contents equivalent
-considers strings equivalent if they have the same characters
-looser definition of equivalence for bit vectors and pathnames
-than eql
equalp -(equalp "hello" "hElLo") is true
-(equalp 1 1.0) is true
-some other data structures also have looser equivalence
3 Functions
documentation
return-from
&optional
&rest
&key
block
function
#'
funcall
apply
7 Macros: Standard Control Constructs
progn
when
unless
cond
and
or
not
do
dolist
dotimes
loop
8 Macros: Writing your own
random
gensym
let
9 Practical: Building a Unit Test Framework
append
10 Numbers, Characters, Strings
floor
ceiling
truncate
round
mod
rem
incf
decf
min
max
zerop
minusp
plusp
oddp
log
exp
expt
sin, cos, tan
asin, acos, atan
sinh, cosh, tanh
char=
char-equal
not-greaterp
not-lessp
string=, /=, <, >, <=, >= (case-sensitive)
string-equal, not-equal, lessp, greaterp, not-greaterp, not-lessp (insensitive)
11 Collections
vector
make-array
vector-push
vector-pop
vector-push-extend
length
elt
count
find
position
remove
substitute
remove-if, if-not
remove-duplicates
copy-seq
concatenate
sort
stable-sort
merge
subseq
fill
search
mismatch
every
some
notany
notevery
map
map-into
reduce
make-hash-table
gethash
multiple-value-bind
remhash
clrhash
maphash
12 Lists
cons
car
cdr
first
rest
nreverse
nconc
nsubstitute
n...
nth
last
butlast
nbutlast
ldiff
tailp
list*
make-list
revappend
nreconc
consp
atom
listp
null
maplist
mapcan
mapcon
mapc
mapl
13 Beyond Lists: Other Uses for Cons Cells
copy-tree
tree-equal
subst, -if, -if-not
nsubst, -if, -if-not
adjoin
pushnew
member, -if, -if-not
find, -if, -if-not
intersection, union, set-difference, set-exclusive-or
subsetp
assoc, -if, -if-not
acons
rassoc, -if, -if-not
copy-alist
pairlis
remf
symbol-plist
remprop
destructuring-bind
&whole
14 File and File I/O
open
read-*, line, char, byte, sequence