12 |
;;; nconc |
;;; nconc |
13 |
|
|
14 |
(deftest nconc-1 |
(deftest nconc-1 |
15 |
(nconc) |
(nconc) |
16 |
nil) |
nil) |
17 |
|
|
18 |
(deftest nconc-2 |
(deftest nconc-2 |
19 |
(nconc (copy-tree '(a b c d e f))) |
(nconc (copy-tree '(a b c d e f))) |
20 |
(a b c d e f)) |
(a b c d e f)) |
21 |
|
|
22 |
(deftest nconc-3 |
(deftest nconc-3 |
23 |
(nconc 1) |
(nconc 1) |
24 |
1) |
1) |
25 |
|
|
26 |
(deftest nconc-4 |
(deftest nconc-4 |
27 |
(let ((x (list 'a 'b 'c)) |
(let ((x (list 'a 'b 'c)) |
28 |
(y (list 'd 'e 'f))) |
(y (list 'd 'e 'f))) |
29 |
(let ((ycopy (make-scaffold-copy y))) |
(let ((ycopy (make-scaffold-copy y))) |
30 |
(let ((result (nconc x y))) |
(let ((result (nconc x y))) |
31 |
(and |
(and |
32 |
(check-scaffold-copy y ycopy) |
(check-scaffold-copy y ycopy) |
33 |
(eqt (cdddr x) y) |
(eqt (cdddr x) y) |
34 |
result)))) |
result)))) |
35 |
(a b c d e f)) |
(a b c d e f)) |
36 |
|
|
37 |
(deftest nconc-5 |
(deftest nconc-5 |
38 |
(let ((x (list 'a 'b 'c))) |
(let ((x (list 'a 'b 'c))) |
39 |
(nconc x x) |
(nconc x x) |
40 |
(and |
(and |
41 |
(eqt (cdddr x) x) |
(eqt (cdddr x) x) |
42 |
(null (list-length x)))) |
(null (list-length x)))) |
43 |
t) |
t) |
44 |
|
|
45 |
(deftest nconc-6 |
(deftest nconc-6 |
46 |
(let ((x (list 'a 'b 'c)) |
(let ((x (list 'a 'b 'c)) |
47 |
(y (list 'd 'e 'f 'g 'h)) |
(y (list 'd 'e 'f 'g 'h)) |
48 |
(z (list 'i 'j 'k))) |
(z (list 'i 'j 'k))) |
49 |
(let ((result (nconc x y z 'foo))) |
(let ((result (nconc x y z 'foo))) |
50 |
(and |
(and |
51 |
(eqt (nthcdr 3 x) y) |
(eqt (nthcdr 3 x) y) |
52 |
(eqt (nthcdr 5 y) z) |
(eqt (nthcdr 5 y) z) |
53 |
(eqt (nthcdr 3 z) 'foo) |
(eqt (nthcdr 3 z) 'foo) |
54 |
result))) |
result))) |
55 |
(a b c d e f g h i j k . foo)) |
(a b c d e f g h i j k . foo)) |
56 |
|
|
57 |
|
(deftest nconc-7 |
58 |
|
(nconc (copy-tree '(a . b)) |
59 |
|
(copy-tree '(c . d)) |
60 |
|
(copy-tree '(e . f)) |
61 |
|
'foo) |
62 |
|
(a c e . foo)) |
63 |
|
|
64 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
65 |
;;; append |
;;; append |
66 |
|
|