1 | ;-*- Mode: Lisp -*- |
---|
2 | ;;;; Author: Paul Dietz |
---|
3 | ;;;; Contains: Random type prop tests, part 9 (sequences) |
---|
4 | |
---|
5 | (in-package :cl-test) |
---|
6 | |
---|
7 | ;;; FIND |
---|
8 | |
---|
9 | (def-type-prop-test find.1 'find |
---|
10 | (list t #'make-random-sequence-type-containing) |
---|
11 | 2) |
---|
12 | |
---|
13 | (def-type-prop-test find.2 'find |
---|
14 | (list 'integer #'make-random-sequence-type-containing) |
---|
15 | 2) |
---|
16 | |
---|
17 | (def-type-prop-test find.3 'find |
---|
18 | (list 'character #'make-random-sequence-type-containing) |
---|
19 | 2) |
---|
20 | |
---|
21 | (def-type-prop-test find.4 'find |
---|
22 | (list t |
---|
23 | #'make-random-sequence-type-containing |
---|
24 | '(eql :start) |
---|
25 | #'(lambda (v s k1) (declare (ignore v k1)) |
---|
26 | (let ((len (length s))) |
---|
27 | `(integer 0 ,len)))) |
---|
28 | 4) |
---|
29 | |
---|
30 | (def-type-prop-test find.5 'find |
---|
31 | (list t |
---|
32 | #'make-random-sequence-type-containing |
---|
33 | '(eql :end) |
---|
34 | #'(lambda (v s k1) (declare (ignore v k1)) |
---|
35 | (let ((len (length s))) |
---|
36 | `(integer 0 ,len)))) |
---|
37 | 4) |
---|
38 | |
---|
39 | (def-type-prop-test find.6 'find |
---|
40 | (list t #'make-random-sequence-type-containing |
---|
41 | '(eql :start) |
---|
42 | #'(lambda (v s k1) (declare (ignore v k1)) |
---|
43 | (let ((len (length s))) |
---|
44 | `(integer 0 ,len))) |
---|
45 | '(eql :end) |
---|
46 | #'(lambda (v s k1 start k2) |
---|
47 | (declare (ignore v k1 k2)) |
---|
48 | (let ((len (length s))) |
---|
49 | `(integer ,start ,len)))) |
---|
50 | 6) |
---|
51 | |
---|
52 | (def-type-prop-test find.7 'find |
---|
53 | (list 'integer #'(lambda (x) (declare (ignore x)) |
---|
54 | (make-sequence-type |
---|
55 | (random 10) |
---|
56 | (random-from-seq #(bit integer float rational real number)))) |
---|
57 | '(eql :key) |
---|
58 | '(member 1+ #.#'1+ 1- #.#'1- - #.#'-)) |
---|
59 | 4) |
---|
60 | |
---|
61 | (def-type-prop-test find.8 'find |
---|
62 | (list 'character |
---|
63 | #'(lambda (x) (declare (ignore x)) |
---|
64 | (make-sequence-type |
---|
65 | (random 10) |
---|
66 | (random-from-seq #(character base-char standard-char)))) |
---|
67 | '(eql :key) |
---|
68 | '(member char-upcase #.#'char-upcase |
---|
69 | char-downcase #.#'char-downcase |
---|
70 | upper-case-p #.#'upper-case-p |
---|
71 | lower-case-p #.#'lower-case-p |
---|
72 | both-case-p #.#'both-case-p |
---|
73 | char-code #.#'char-code |
---|
74 | char-int #.#'char-int |
---|
75 | alpha-char-p #.#'alpha-char-p |
---|
76 | digit-char-p #.#'digit-char-p |
---|
77 | alphanumericp #.#'alphanumericp)) |
---|
78 | 4) |
---|
79 | |
---|
80 | (def-type-prop-test find.9 'find |
---|
81 | (list t #'make-random-sequence-type-containing |
---|
82 | '(eql :from-end) |
---|
83 | '(or null t)) |
---|
84 | 4) |
---|
85 | |
---|
86 | (def-type-prop-test find.10 'find |
---|
87 | (list 'real #'(lambda (x) (make-sequence-type |
---|
88 | (random 10) |
---|
89 | (random-from-seq #(bit integer float rational real)))) |
---|
90 | '(eql :from-end) |
---|
91 | '(or null t) |
---|
92 | '(member :test :test-not) |
---|
93 | (list 'member '< #'< '> #'> '<= #'<= '>= #'>= '= #'= '/= #'/= |
---|
94 | 'equal #'equal 'eql #'eql)) |
---|
95 | 6) |
---|
96 | |
---|
97 | ;;; FIND-IF |
---|
98 | |
---|
99 | (def-type-prop-test find-if.1 'find-if |
---|
100 | (list |
---|
101 | (append '(member) *cl-safe-predicates* |
---|
102 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
103 | 'sequence) |
---|
104 | 2) |
---|
105 | |
---|
106 | (def-type-prop-test find-if.2 'find-if |
---|
107 | (list |
---|
108 | (let ((char-predicates |
---|
109 | '(alpha-char-p digit-char-p upper-case-p lower-case-p |
---|
110 | both-case-p alphanumericp graphic-char-p |
---|
111 | standard-char-p))) |
---|
112 | (append '(member) char-predicates |
---|
113 | (mapcar #'symbol-function char-predicates))) |
---|
114 | #'(lambda (x) (declare (ignore x)) |
---|
115 | (make-sequence-type (random 10) |
---|
116 | '(or standard-char base-char character)))) |
---|
117 | 2) |
---|
118 | |
---|
119 | (def-type-prop-test find-if.3 'find-if |
---|
120 | (list |
---|
121 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
122 | (append '(member) integer-predicates |
---|
123 | (mapcar #'symbol-function integer-predicates))) |
---|
124 | #'(lambda (x) (declare (ignore x)) |
---|
125 | (make-sequence-type (random 10) |
---|
126 | `(or bit bit bit bit bit bit bit |
---|
127 | ,@(loop for x from 2 to 32 |
---|
128 | collect `(unsigned-byte ,x)) |
---|
129 | ,@(loop for x from 2 to 32 |
---|
130 | collect `(signed-byte ,x)))))) |
---|
131 | 2) |
---|
132 | |
---|
133 | (def-type-prop-test find-if.4 'find-if |
---|
134 | (list |
---|
135 | (append '(member) *cl-safe-predicates* |
---|
136 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
137 | 'sequence |
---|
138 | '(eql :start) |
---|
139 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
140 | (let ((len (length s))) |
---|
141 | `(integer 0 ,len)))) |
---|
142 | 4) |
---|
143 | |
---|
144 | (def-type-prop-test find-if.5 'find-if |
---|
145 | (list |
---|
146 | (append '(member) *cl-safe-predicates* |
---|
147 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
148 | 'sequence |
---|
149 | '(eql :end) |
---|
150 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
151 | (let ((len (length s))) |
---|
152 | `(integer 0 ,len)))) |
---|
153 | 4) |
---|
154 | |
---|
155 | (def-type-prop-test find-if.6 'find-if |
---|
156 | (list |
---|
157 | (append '(member) *cl-safe-predicates* |
---|
158 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
159 | 'sequence |
---|
160 | '(eql :start) |
---|
161 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
162 | (let ((len (length s))) |
---|
163 | `(integer 0 ,len))) |
---|
164 | '(eql :end) |
---|
165 | #'(lambda (f s k1 start k2) |
---|
166 | (declare (ignore f k1 k2)) |
---|
167 | (let ((len (length s))) |
---|
168 | `(integer ,start ,len)))) |
---|
169 | 6) |
---|
170 | |
---|
171 | (def-type-prop-test find-if.7 'find-if |
---|
172 | (list |
---|
173 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
174 | (append '(member) integer-predicates |
---|
175 | (mapcar #'symbol-function integer-predicates))) |
---|
176 | #'(lambda (x) (declare (ignore x)) |
---|
177 | (make-sequence-type (random 10) |
---|
178 | `(or bit bit bit bit bit bit bit |
---|
179 | ,@(loop for x from 2 to 32 |
---|
180 | collect `(unsigned-byte ,x)) |
---|
181 | ,@(loop for x from 2 to 32 |
---|
182 | collect `(signed-byte ,x))))) |
---|
183 | '(eql :key) |
---|
184 | (list 'member '1+ '1- 'identity '- |
---|
185 | #'1+ #'1- #'identity #'-)) |
---|
186 | 4) |
---|
187 | |
---|
188 | (def-type-prop-test find-if.8 'find-if |
---|
189 | (list |
---|
190 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
191 | (append '(member) integer-predicates |
---|
192 | (mapcar #'symbol-function integer-predicates))) |
---|
193 | #'(lambda (x) (declare (ignore x)) |
---|
194 | (make-sequence-type (random 10) |
---|
195 | `(or bit bit bit bit bit bit bit |
---|
196 | ,@(loop for x from 2 to 32 |
---|
197 | collect `(unsigned-byte ,x)) |
---|
198 | ,@(loop for x from 2 to 32 |
---|
199 | collect `(signed-byte ,x))))) |
---|
200 | '(eql :from-end) |
---|
201 | '(or null t)) |
---|
202 | 4) |
---|
203 | |
---|
204 | (def-type-prop-test find-if.9 'find-if |
---|
205 | (list |
---|
206 | (append '(member) *cl-safe-predicates* |
---|
207 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
208 | 'sequence |
---|
209 | '(eql :start) |
---|
210 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
211 | (let ((len (length s))) |
---|
212 | `(integer 0 ,len))) |
---|
213 | '(eql :from-end) |
---|
214 | '(or null t)) |
---|
215 | 6) |
---|
216 | |
---|
217 | (def-type-prop-test find-if.10 'find-if |
---|
218 | (list |
---|
219 | (append '(member) *cl-safe-predicates* |
---|
220 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
221 | 'sequence |
---|
222 | '(eql :end) |
---|
223 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
224 | (let ((len (length s))) |
---|
225 | `(integer 0 ,len))) |
---|
226 | '(eql :from-end) |
---|
227 | '(or null t)) |
---|
228 | 6) |
---|
229 | |
---|
230 | ;;; FIND-IF-NOT |
---|
231 | |
---|
232 | (def-type-prop-test find-if-not.1 'find-if-not |
---|
233 | (list |
---|
234 | (append '(member) *cl-safe-predicates* |
---|
235 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
236 | 'sequence) |
---|
237 | 2) |
---|
238 | |
---|
239 | (def-type-prop-test find-if-not.2 'find-if-not |
---|
240 | (list |
---|
241 | (let ((char-predicates |
---|
242 | '(alpha-char-p digit-char-p upper-case-p lower-case-p |
---|
243 | both-case-p alphanumericp graphic-char-p |
---|
244 | standard-char-p))) |
---|
245 | (append '(member) char-predicates |
---|
246 | (mapcar #'symbol-function char-predicates))) |
---|
247 | #'(lambda (x) (declare (ignore x)) |
---|
248 | (make-sequence-type (random 10) |
---|
249 | '(or standard-char base-char character)))) |
---|
250 | 2) |
---|
251 | |
---|
252 | (def-type-prop-test find-if-not.3 'find-if-not |
---|
253 | (list |
---|
254 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
255 | (append '(member) integer-predicates |
---|
256 | (mapcar #'symbol-function integer-predicates))) |
---|
257 | #'(lambda (x) (declare (ignore x)) |
---|
258 | (make-sequence-type (random 10) |
---|
259 | `(or bit bit bit bit bit bit bit |
---|
260 | ,@(loop for x from 2 to 32 |
---|
261 | collect `(unsigned-byte ,x)) |
---|
262 | ,@(loop for x from 2 to 32 |
---|
263 | collect `(signed-byte ,x)))))) |
---|
264 | 2) |
---|
265 | |
---|
266 | (def-type-prop-test find-if-not.4 'find-if-not |
---|
267 | (list |
---|
268 | (append '(member) *cl-safe-predicates* |
---|
269 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
270 | 'sequence |
---|
271 | '(eql :start) |
---|
272 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
273 | (let ((len (length s))) |
---|
274 | `(integer 0 ,len)))) |
---|
275 | 4) |
---|
276 | |
---|
277 | (def-type-prop-test find-if-not.5 'find-if-not |
---|
278 | (list |
---|
279 | (append '(member) *cl-safe-predicates* |
---|
280 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
281 | 'sequence |
---|
282 | '(eql :end) |
---|
283 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
284 | (let ((len (length s))) |
---|
285 | `(integer 0 ,len)))) |
---|
286 | 4) |
---|
287 | |
---|
288 | (def-type-prop-test find-if-not.6 'find-if-not |
---|
289 | (list |
---|
290 | (append '(member) *cl-safe-predicates* |
---|
291 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
292 | 'sequence |
---|
293 | '(eql :start) |
---|
294 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
295 | (let ((len (length s))) |
---|
296 | `(integer 0 ,len))) |
---|
297 | '(eql :end) |
---|
298 | #'(lambda (f s k1 start k2) |
---|
299 | (declare (ignore f k1 k2)) |
---|
300 | (let ((len (length s))) |
---|
301 | `(integer ,start ,len)))) |
---|
302 | 6) |
---|
303 | |
---|
304 | (def-type-prop-test find-if-not.7 'find-if-not |
---|
305 | (list |
---|
306 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
307 | (append '(member) integer-predicates |
---|
308 | (mapcar #'symbol-function integer-predicates))) |
---|
309 | #'(lambda (x) (declare (ignore x)) |
---|
310 | (make-sequence-type (random 10) |
---|
311 | `(or bit bit bit bit bit bit bit |
---|
312 | ,@(loop for x from 2 to 32 |
---|
313 | collect `(unsigned-byte ,x)) |
---|
314 | ,@(loop for x from 2 to 32 |
---|
315 | collect `(signed-byte ,x))))) |
---|
316 | '(eql :key) |
---|
317 | (list 'member '1+ '1- 'identity '- |
---|
318 | #'1+ #'1- #'identity #'-)) |
---|
319 | 4) |
---|
320 | |
---|
321 | (def-type-prop-test find-if-not.8 'find-if-not |
---|
322 | (list |
---|
323 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
324 | (append '(member) integer-predicates |
---|
325 | (mapcar #'symbol-function integer-predicates))) |
---|
326 | #'(lambda (x) (declare (ignore x)) |
---|
327 | (make-sequence-type (random 10) |
---|
328 | `(or bit bit bit bit bit bit bit |
---|
329 | ,@(loop for x from 2 to 32 |
---|
330 | collect `(unsigned-byte ,x)) |
---|
331 | ,@(loop for x from 2 to 32 |
---|
332 | collect `(signed-byte ,x))))) |
---|
333 | '(eql :from-end) |
---|
334 | '(or null t)) |
---|
335 | 4) |
---|
336 | |
---|
337 | (def-type-prop-test find-if-not.9 'find-if-not |
---|
338 | (list |
---|
339 | (append '(member) *cl-safe-predicates* |
---|
340 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
341 | 'sequence |
---|
342 | '(eql :start) |
---|
343 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
344 | (let ((len (length s))) |
---|
345 | `(integer 0 ,len))) |
---|
346 | '(eql :from-end) |
---|
347 | '(or null t)) |
---|
348 | 6) |
---|
349 | |
---|
350 | (def-type-prop-test find-if-not.10 'find-if-not |
---|
351 | (list |
---|
352 | (append '(member) *cl-safe-predicates* |
---|
353 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
354 | 'sequence |
---|
355 | '(eql :end) |
---|
356 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
357 | (let ((len (length s))) |
---|
358 | `(integer 0 ,len))) |
---|
359 | '(eql :from-end) |
---|
360 | '(or null t)) |
---|
361 | 6) |
---|
362 | |
---|
363 | ;;; POSITION |
---|
364 | |
---|
365 | (def-type-prop-test position.1 'position |
---|
366 | (list t #'make-random-sequence-type-containing) |
---|
367 | 2) |
---|
368 | |
---|
369 | (def-type-prop-test position.2 'position |
---|
370 | (list 'integer #'make-random-sequence-type-containing) |
---|
371 | 2) |
---|
372 | |
---|
373 | (def-type-prop-test position.3 'position |
---|
374 | (list 'character #'make-random-sequence-type-containing) |
---|
375 | 2) |
---|
376 | |
---|
377 | (def-type-prop-test position.4 'position |
---|
378 | (list t |
---|
379 | #'make-random-sequence-type-containing |
---|
380 | '(eql :start) |
---|
381 | #'(lambda (v s k1) (declare (ignore v k1)) |
---|
382 | (let ((len (length s))) |
---|
383 | `(integer 0 ,len)))) |
---|
384 | 4) |
---|
385 | |
---|
386 | (def-type-prop-test position.5 'position |
---|
387 | (list t |
---|
388 | #'make-random-sequence-type-containing |
---|
389 | '(eql :end) |
---|
390 | #'(lambda (v s k1) (declare (ignore v k1)) |
---|
391 | (let ((len (length s))) |
---|
392 | `(integer 0 ,len)))) |
---|
393 | 4) |
---|
394 | |
---|
395 | (def-type-prop-test position.6 'position |
---|
396 | (list t #'make-random-sequence-type-containing |
---|
397 | '(eql :start) |
---|
398 | #'(lambda (v s k1) (declare (ignore v k1)) |
---|
399 | (let ((len (length s))) |
---|
400 | `(integer 0 ,len))) |
---|
401 | '(eql :end) |
---|
402 | #'(lambda (v s k1 start k2) |
---|
403 | (declare (ignore v k1 k2)) |
---|
404 | (let ((len (length s))) |
---|
405 | `(integer ,start ,len)))) |
---|
406 | 6) |
---|
407 | |
---|
408 | (def-type-prop-test position.7 'position |
---|
409 | (list 'integer #'(lambda (x) (declare (ignore x)) |
---|
410 | (make-sequence-type |
---|
411 | (random 10) |
---|
412 | (random-from-seq #(bit integer float rational real number)))) |
---|
413 | '(eql :key) |
---|
414 | '(member 1+ #.#'1+ 1- #.#'1- - #.#'-)) |
---|
415 | 4) |
---|
416 | |
---|
417 | (def-type-prop-test position.8 'position |
---|
418 | (list 'character |
---|
419 | #'(lambda (x) (declare (ignore x)) |
---|
420 | (make-sequence-type |
---|
421 | (random 10) |
---|
422 | (random-from-seq #(character base-char standard-char)))) |
---|
423 | '(eql :key) |
---|
424 | '(member char-upcase #.#'char-upcase |
---|
425 | char-downcase #.#'char-downcase |
---|
426 | upper-case-p #.#'upper-case-p |
---|
427 | lower-case-p #.#'lower-case-p |
---|
428 | both-case-p #.#'both-case-p |
---|
429 | char-code #.#'char-code |
---|
430 | char-int #.#'char-int |
---|
431 | alpha-char-p #.#'alpha-char-p |
---|
432 | digit-char-p #.#'digit-char-p |
---|
433 | alphanumericp #.#'alphanumericp)) |
---|
434 | 4) |
---|
435 | |
---|
436 | (def-type-prop-test position.9 'position |
---|
437 | (list t #'make-random-sequence-type-containing |
---|
438 | '(eql :from-end) |
---|
439 | '(or null t)) |
---|
440 | 4) |
---|
441 | |
---|
442 | (def-type-prop-test position.10 'position |
---|
443 | (list 'real #'(lambda (x) (make-sequence-type |
---|
444 | (random 10) |
---|
445 | (random-from-seq #(bit integer float rational real)))) |
---|
446 | '(eql :from-end) |
---|
447 | '(or null t) |
---|
448 | '(member :test :test-not) |
---|
449 | (list 'member '< #'< '> #'> '<= #'<= '>= #'>= '= #'= '/= #'/= |
---|
450 | 'equal #'equal 'eql #'eql)) |
---|
451 | 6) |
---|
452 | |
---|
453 | ;;; POSITION-IF |
---|
454 | |
---|
455 | (def-type-prop-test position-if.1 'position-if |
---|
456 | (list |
---|
457 | (append '(member) *cl-safe-predicates* |
---|
458 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
459 | 'sequence) |
---|
460 | 2) |
---|
461 | |
---|
462 | (def-type-prop-test position-if.2 'position-if |
---|
463 | (list |
---|
464 | (let ((char-predicates |
---|
465 | '(alpha-char-p digit-char-p upper-case-p lower-case-p |
---|
466 | both-case-p alphanumericp graphic-char-p |
---|
467 | standard-char-p))) |
---|
468 | (append '(member) char-predicates |
---|
469 | (mapcar #'symbol-function char-predicates))) |
---|
470 | #'(lambda (x) (declare (ignore x)) |
---|
471 | (make-sequence-type (random 10) |
---|
472 | '(or standard-char base-char character)))) |
---|
473 | 2) |
---|
474 | |
---|
475 | (def-type-prop-test position-if.3 'position-if |
---|
476 | (list |
---|
477 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
478 | (append '(member) integer-predicates |
---|
479 | (mapcar #'symbol-function integer-predicates))) |
---|
480 | #'(lambda (x) (declare (ignore x)) |
---|
481 | (make-sequence-type (random 10) |
---|
482 | `(or bit bit bit bit bit bit bit |
---|
483 | ,@(loop for x from 2 to 32 |
---|
484 | collect `(unsigned-byte ,x)) |
---|
485 | ,@(loop for x from 2 to 32 |
---|
486 | collect `(signed-byte ,x)))))) |
---|
487 | 2) |
---|
488 | |
---|
489 | (def-type-prop-test position-if.4 'position-if |
---|
490 | (list |
---|
491 | (append '(member) *cl-safe-predicates* |
---|
492 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
493 | 'sequence |
---|
494 | '(eql :start) |
---|
495 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
496 | (let ((len (length s))) |
---|
497 | `(integer 0 ,len)))) |
---|
498 | 4) |
---|
499 | |
---|
500 | (def-type-prop-test position-if.5 'position-if |
---|
501 | (list |
---|
502 | (append '(member) *cl-safe-predicates* |
---|
503 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
504 | 'sequence |
---|
505 | '(eql :end) |
---|
506 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
507 | (let ((len (length s))) |
---|
508 | `(integer 0 ,len)))) |
---|
509 | 4) |
---|
510 | |
---|
511 | (def-type-prop-test position-if.6 'position-if |
---|
512 | (list |
---|
513 | (append '(member) *cl-safe-predicates* |
---|
514 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
515 | 'sequence |
---|
516 | '(eql :start) |
---|
517 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
518 | (let ((len (length s))) |
---|
519 | `(integer 0 ,len))) |
---|
520 | '(eql :end) |
---|
521 | #'(lambda (f s k1 start k2) |
---|
522 | (declare (ignore f k1 k2)) |
---|
523 | (let ((len (length s))) |
---|
524 | `(integer ,start ,len)))) |
---|
525 | 6) |
---|
526 | |
---|
527 | (def-type-prop-test position-if.7 'position-if |
---|
528 | (list |
---|
529 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
530 | (append '(member) integer-predicates |
---|
531 | (mapcar #'symbol-function integer-predicates))) |
---|
532 | #'(lambda (x) (declare (ignore x)) |
---|
533 | (make-sequence-type (random 10) |
---|
534 | `(or bit bit bit bit bit bit bit |
---|
535 | ,@(loop for x from 2 to 32 |
---|
536 | collect `(unsigned-byte ,x)) |
---|
537 | ,@(loop for x from 2 to 32 |
---|
538 | collect `(signed-byte ,x))))) |
---|
539 | '(eql :key) |
---|
540 | (list 'member '1+ '1- 'identity '- |
---|
541 | #'1+ #'1- #'identity #'-)) |
---|
542 | 4) |
---|
543 | |
---|
544 | (def-type-prop-test position-if.8 'position-if |
---|
545 | (list |
---|
546 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
547 | (append '(member) integer-predicates |
---|
548 | (mapcar #'symbol-function integer-predicates))) |
---|
549 | #'(lambda (x) (declare (ignore x)) |
---|
550 | (make-sequence-type (random 10) |
---|
551 | `(or bit bit bit bit bit bit bit |
---|
552 | ,@(loop for x from 2 to 32 |
---|
553 | collect `(unsigned-byte ,x)) |
---|
554 | ,@(loop for x from 2 to 32 |
---|
555 | collect `(signed-byte ,x))))) |
---|
556 | '(eql :from-end) |
---|
557 | '(or null t)) |
---|
558 | 4) |
---|
559 | |
---|
560 | (def-type-prop-test position-if.9 'position-if |
---|
561 | (list |
---|
562 | (append '(member) *cl-safe-predicates* |
---|
563 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
564 | 'sequence |
---|
565 | '(eql :start) |
---|
566 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
567 | (let ((len (length s))) |
---|
568 | `(integer 0 ,len))) |
---|
569 | '(eql :from-end) |
---|
570 | '(or null t)) |
---|
571 | 6) |
---|
572 | |
---|
573 | (def-type-prop-test position-if.10 'position-if |
---|
574 | (list |
---|
575 | (append '(member) *cl-safe-predicates* |
---|
576 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
577 | 'sequence |
---|
578 | '(eql :end) |
---|
579 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
580 | (let ((len (length s))) |
---|
581 | `(integer 0 ,len))) |
---|
582 | '(eql :from-end) |
---|
583 | '(or null t)) |
---|
584 | 6) |
---|
585 | |
---|
586 | ;;; POSITION-IF-NOT |
---|
587 | |
---|
588 | (def-type-prop-test position-if-not.1 'position-if-not |
---|
589 | (list |
---|
590 | (append '(member) *cl-safe-predicates* |
---|
591 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
592 | 'sequence) |
---|
593 | 2) |
---|
594 | |
---|
595 | (def-type-prop-test position-if-not.2 'position-if-not |
---|
596 | (list |
---|
597 | (let ((char-predicates |
---|
598 | '(alpha-char-p digit-char-p upper-case-p lower-case-p |
---|
599 | both-case-p alphanumericp graphic-char-p |
---|
600 | standard-char-p))) |
---|
601 | (append '(member) char-predicates |
---|
602 | (mapcar #'symbol-function char-predicates))) |
---|
603 | #'(lambda (x) (declare (ignore x)) |
---|
604 | (make-sequence-type (random 10) |
---|
605 | '(or standard-char base-char character)))) |
---|
606 | 2) |
---|
607 | |
---|
608 | (def-type-prop-test position-if-not.3 'position-if-not |
---|
609 | (list |
---|
610 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
611 | (append '(member) integer-predicates |
---|
612 | (mapcar #'symbol-function integer-predicates))) |
---|
613 | #'(lambda (x) (declare (ignore x)) |
---|
614 | (make-sequence-type (random 10) |
---|
615 | `(or bit bit bit bit bit bit bit |
---|
616 | ,@(loop for x from 2 to 32 |
---|
617 | collect `(unsigned-byte ,x)) |
---|
618 | ,@(loop for x from 2 to 32 |
---|
619 | collect `(signed-byte ,x)))))) |
---|
620 | 2) |
---|
621 | |
---|
622 | (def-type-prop-test position-if-not.4 'position-if-not |
---|
623 | (list |
---|
624 | (append '(member) *cl-safe-predicates* |
---|
625 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
626 | 'sequence |
---|
627 | '(eql :start) |
---|
628 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
629 | (let ((len (length s))) |
---|
630 | `(integer 0 ,len)))) |
---|
631 | 4) |
---|
632 | |
---|
633 | (def-type-prop-test position-if-not.5 'position-if-not |
---|
634 | (list |
---|
635 | (append '(member) *cl-safe-predicates* |
---|
636 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
637 | 'sequence |
---|
638 | '(eql :end) |
---|
639 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
640 | (let ((len (length s))) |
---|
641 | `(integer 0 ,len)))) |
---|
642 | 4) |
---|
643 | |
---|
644 | (def-type-prop-test position-if-not.6 'position-if-not |
---|
645 | (list |
---|
646 | (append '(member) *cl-safe-predicates* |
---|
647 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
648 | 'sequence |
---|
649 | '(eql :start) |
---|
650 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
651 | (let ((len (length s))) |
---|
652 | `(integer 0 ,len))) |
---|
653 | '(eql :end) |
---|
654 | #'(lambda (f s k1 start k2) |
---|
655 | (declare (ignore f k1 k2)) |
---|
656 | (let ((len (length s))) |
---|
657 | `(integer ,start ,len)))) |
---|
658 | 6) |
---|
659 | |
---|
660 | (def-type-prop-test position-if-not.7 'position-if-not |
---|
661 | (list |
---|
662 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
663 | (append '(member) integer-predicates |
---|
664 | (mapcar #'symbol-function integer-predicates))) |
---|
665 | #'(lambda (x) (declare (ignore x)) |
---|
666 | (make-sequence-type (random 10) |
---|
667 | `(or bit bit bit bit bit bit bit |
---|
668 | ,@(loop for x from 2 to 32 |
---|
669 | collect `(unsigned-byte ,x)) |
---|
670 | ,@(loop for x from 2 to 32 |
---|
671 | collect `(signed-byte ,x))))) |
---|
672 | '(eql :key) |
---|
673 | (list 'member '1+ '1- 'identity '- |
---|
674 | #'1+ #'1- #'identity #'-)) |
---|
675 | 4) |
---|
676 | |
---|
677 | (def-type-prop-test position-if-not.8 'position-if-not |
---|
678 | (list |
---|
679 | (let ((integer-predicates '(zerop plusp minusp evenp oddp))) |
---|
680 | (append '(member) integer-predicates |
---|
681 | (mapcar #'symbol-function integer-predicates))) |
---|
682 | #'(lambda (x) (declare (ignore x)) |
---|
683 | (make-sequence-type (random 10) |
---|
684 | `(or bit bit bit bit bit bit bit |
---|
685 | ,@(loop for x from 2 to 32 |
---|
686 | collect `(unsigned-byte ,x)) |
---|
687 | ,@(loop for x from 2 to 32 |
---|
688 | collect `(signed-byte ,x))))) |
---|
689 | '(eql :from-end) |
---|
690 | '(or null t)) |
---|
691 | 4) |
---|
692 | |
---|
693 | (def-type-prop-test position-if-not.9 'position-if-not |
---|
694 | (list |
---|
695 | (append '(member) *cl-safe-predicates* |
---|
696 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
697 | 'sequence |
---|
698 | '(eql :start) |
---|
699 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
700 | (let ((len (length s))) |
---|
701 | `(integer 0 ,len))) |
---|
702 | '(eql :from-end) |
---|
703 | '(or null t)) |
---|
704 | 6) |
---|
705 | |
---|
706 | (def-type-prop-test position-if-not.10 'position-if-not |
---|
707 | (list |
---|
708 | (append '(member) *cl-safe-predicates* |
---|
709 | (mapcar 'symbol-function *cl-safe-predicates*)) |
---|
710 | 'sequence |
---|
711 | '(eql :end) |
---|
712 | #'(lambda (f s k1) (declare (ignore f k1)) |
---|
713 | (let ((len (length s))) |
---|
714 | `(integer 0 ,len))) |
---|
715 | '(eql :from-end) |
---|
716 | '(or null t)) |
---|
717 | 6) |
---|