-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkey-value-store.html
308 lines (288 loc) · 10.8 KB
/
key-value-store.html
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html>
<html>
<head>
<style>
pre {
white-space: pre-wrap;
padding: 0; /* So pre sections won't have too much space around them */
margin: 0;
}
</style>
</head>
<body>
<div style="margin: auto; width:95%;"><h2>Documentation for package :KEY-VALUE-STORE</h2>
<i>This documentation was created by <a href=https://github.com/svspire/cl-simpledoc>cl-simpledoc</a></i>
<p>
<h3 style="color:green;">External Symbols</h3>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>clear-store! </font>(store)</code></B></TD>
<TD ALIGN=RIGHT><I>[Macro]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Macro version of clear-store. Automatically adds (setf store ...) in front
of the call.</div></TD>
</TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>relate! </font>(store key value &rest args)</code></B></TD>
<TD ALIGN=RIGHT><I>[Macro]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Macro version of relate. Automatically adds (setf store ...) in front
of the call, and returns both values thereof properly.</div></TD>
</TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>relate-unique! </font>(store key value &rest args)</code></B></TD>
<TD ALIGN=RIGHT><I>[Macro]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Macro version of relate-unique. Automatically adds (setf store ...) in front
of the relate call.</div></TD>
</TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>remove-key! </font>(store key &rest args)</code></B></TD>
<TD ALIGN=RIGHT><I>[Macro]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Macro version of remove-key. Automatically adds (setf store ...) in front
of the call, and returns both values thereof properly.</div></TD>
</TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>tally! </font>(store key amount &rest args)</code></B></TD>
<TD ALIGN=RIGHT><I>[Macro]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Macro version of tally. Automatically adds (setf store ...) in front
of the call, and returns both values thereof properly.</div></TD>
</TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>clear-store </font>(store)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Removes all associations from store and returns
empty store.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>clear-store ((store list))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>clear-store ((store hash-table))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>lookup-key </font>(store key &key test default)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Returns value(s) associated with key in store, if any, or
default if none. If multiple values are associated with key, they
are returned as a collection of some kind, not as multiple values.
Returns second value of present-p, which is true if key was actually present in store.
In some stores (like alists) you can specify a test for matching the given key.
In other stores (like hashtables), test is ignored because it's a property of the data structure itself.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>lookup-key ((store list) key &key (test #'equal) (default nil))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>lookup-key ((store hash-table) key &key test (default nil))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>make-store </font>(style &rest other-args)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Returns a store of the given style, where style is one
of :ALIST or :HASHTABLE or any other style with a method defined.
It's not essential that you use this, it's just for convenience and consistency.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>make-store ((style (:eql :hashtable)) &rest other-args)</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>make-store ((style (:eql :alist)) &rest other-args)</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>relate </font>(store key value &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Create a key/value association in store.
If key already exists in store, this adds a new association
but doesn't remove the old association(s) for that key.
Returns [possibly modified] store. Second value returned is true if store was actually modified.
In some stores (like alists) you can specify a test for matching the given key.
In other stores (like hashtables), test is ignored because it's a property of the data structure itself.
IMPORTANT NOTE: It's important to do (setf alist (relate alist key value)), because while it may destructively
modify alists, there are no guarantees.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>relate ((store list) key value &key (test #'equal))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>relate ((store hash-table) key value &key (test #'equal))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>relate-unique </font>(store key value &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Create a key/value association in store.
If key already exists in store, this replaces that association.
Returns [always-modified] store. No second value.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>relate-unique ((store list) key value &key (test #'equal))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>May destructively modify store. But you should still use (setf store (relate-unique store key value)).</div></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>relate-unique ((store hash-table) key value &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>remove-key </font>(store key &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Removes key and any value(s) associated
with it from store. Returns [possibly modified] store. Second value returned is true
if store was actually modified.
In some stores (like alists) you can specify a test for matching the given key.
In other stores (like hashtables), test is ignored because it's a property of the data structure itself.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>remove-key ((store list) key &key (test #'equal))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>remove-key ((store hash-table) key &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<TABLE CELLPADDING=3 WIDTH="100%">
<TR>
<TD ALIGN=LEFT><B><code><font size=+1>tally </font>(store key amount &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[Generic function]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Increments the value in the key/value pair in the given data-structure by the indicated amount.
[Expects only one value is associated with key in store.]
In some stores (like alists) you can specify a test for matching the given key.
In other stores (like hashtables), test is ignored because it's a property of the data structure itself.
Returns 2 values: New store and new total.</div></TD>
</TR><TR><TD COLSPAN=2 ALIGN=RIGHT>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>tally ((store list) key amount &key (test #'equal))</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Increments the key . value pair in alist indicated by key, by the indicated amount.
If such a pair doesn't exist, create it.</div></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>tally ((store hash-table) key amount &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><div style='white-space: normal;'>Increments the key . value pair in hashtable indicated by key, by the indicated amount.
If such a pair doesn't exist, create it.</div></TD>
</TR>
</TABLE>
<TABLE CELLPADDING=3 WIDTH="95%">
<TR>
<TD ALIGN=LEFT><B><CODE>tally :before (store key amount &key test)</code></B></TD>
<TD ALIGN=RIGHT><I>[method]</I></TD></TR>
<TR>
<TD COLSPAN=2><i>[No documentation found]</i></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<BR/>
<hr>
<h3 style="color:red;">Internal Symbols</h3>
</div>
</body>
</html>