78 |
(:method ((x t) (y t) (z t)) (list x y z)))))) |
(:method ((x t) (y t) (z t)) (list x y z)))))) |
79 |
(values |
(values |
80 |
(typep* fn 'generic-function) |
(typep* fn 'generic-function) |
81 |
|
(typep* fn 'standard-generic-function) |
82 |
(funcall fn 'a 'b 'c) |
(funcall fn 'a 'b 'c) |
83 |
|
(apply fn 1 2 3 nil) |
84 |
|
(apply fn (list 4 5 6)) |
85 |
|
(mapcar fn '(1 2) '(3 4) '(5 6)) |
86 |
(defgeneric.fun.1 'd 'e 'f))) |
(defgeneric.fun.1 'd 'e 'f))) |
87 |
t (a b c) (d e f)) |
t t (a b c) (1 2 3) (4 5 6) ((1 3 5) (2 4 6)) (d e f)) |
88 |
|
|
89 |
(deftest defgeneric.2 |
(deftest defgeneric.2 |
90 |
(let ((fn (eval '(defgeneric defgeneric.fun.2 (x y z) |
(let ((fn (eval '(defgeneric defgeneric.fun.2 (x y z) |
92 |
(:method ((x t) (y t) (z t)) (vector x y z)))))) |
(:method ((x t) (y t) (z t)) (vector x y z)))))) |
93 |
(values |
(values |
94 |
(typep* fn 'generic-function) |
(typep* fn 'generic-function) |
95 |
|
(typep* fn 'standard-generic-function) |
96 |
(funcall fn 'a 'b 'c) |
(funcall fn 'a 'b 'c) |
97 |
(defgeneric.fun.2 'd 'e 'f) |
(defgeneric.fun.2 'd 'e 'f) |
98 |
(let ((doc (documentation fn t))) |
(let ((doc (documentation fn t))) |
102 |
(or (not doc) |
(or (not doc) |
103 |
(and (stringp doc) (string=t doc "boo!")))))) |
(and (stringp doc) (string=t doc "boo!")))))) |
104 |
|
|
105 |
t #(a b c) #(d e f) t t) |
t t #(a b c) #(d e f) t t) |
106 |
|
|
107 |
(deftest defgeneric.3 |
(deftest defgeneric.3 |
108 |
(let ((fn (eval '(defgeneric defgeneric.fun.3 (x y) |
(let ((fn (eval '(defgeneric defgeneric.fun.3 (x y) |
110 |
(:method ((x symbol) (y t)) (list y x)))))) |
(:method ((x symbol) (y t)) (list y x)))))) |
111 |
(values |
(values |
112 |
(typep* fn 'generic-function) |
(typep* fn 'generic-function) |
113 |
|
(typep* fn 'standard-generic-function) |
114 |
(funcall fn 1 'a) |
(funcall fn 1 'a) |
115 |
(funcall fn 'b 2) |
(funcall fn 'b 2) |
116 |
(funcall fn 'a 'b))) |
(funcall fn 'a 'b))) |
117 |
t |
t t |
118 |
(1 a) |
(1 a) |
119 |
(2 b) |
(2 b) |
120 |
(b a)) |
(b a)) |
126 |
(:method ((x symbol) (y t)) (list y x)))))) |
(:method ((x symbol) (y t)) (list y x)))))) |
127 |
(values |
(values |
128 |
(typep* fn 'generic-function) |
(typep* fn 'generic-function) |
129 |
|
(typep* fn 'standard-generic-function) |
130 |
(funcall fn 1 'a) |
(funcall fn 1 'a) |
131 |
(funcall fn 'b 2) |
(funcall fn 'b 2) |
132 |
(funcall fn 'a 'b))) |
(funcall fn 'a 'b))) |
133 |
t |
t t |
134 |
(1 a) |
(1 a) |
135 |
(2 b) |
(2 b) |
136 |
(a b)) |
(a b)) |
137 |
|
|
138 |
|
(deftest defgeneric.5 |
139 |
|
(let ((fn (eval '(defgeneric defgeneric.fun.5 () |
140 |
|
(:method () (values)))))) |
141 |
|
(values |
142 |
|
(typep* fn 'generic-function) |
143 |
|
(typep* fn 'standard-generic-function) |
144 |
|
(multiple-value-list (funcall fn)) |
145 |
|
(multiple-value-list (defgeneric.fun.5)) |
146 |
|
(multiple-value-list (apply fn nil)))) |
147 |
|
t t nil nil nil) |
148 |
|
|
149 |
|
(deftest defgeneric.6 |
150 |
|
(let ((fn (eval '(defgeneric defgeneric.fun.6 () |
151 |
|
(:method () (values 'a 'b 'c)))))) |
152 |
|
(values |
153 |
|
(typep* fn 'generic-function) |
154 |
|
(typep* fn 'standard-generic-function) |
155 |
|
(multiple-value-list (funcall fn)) |
156 |
|
(multiple-value-list (defgeneric.fun.6)) |
157 |
|
(multiple-value-list (apply fn nil)))) |
158 |
|
t t (a b c) (a b c) (a b c)) |
159 |
|
|
160 |
|
(deftest defgeneric.7 |
161 |
|
(let ((fn (eval '(defgeneric defgeneric.fun.7 () |
162 |
|
(:method () (return-from defgeneric.fun.7 'a) 'b))))) |
163 |
|
(values |
164 |
|
(typep* fn 'generic-function) |
165 |
|
(typep* fn 'standard-generic-function) |
166 |
|
(multiple-value-list (funcall fn)) |
167 |
|
(multiple-value-list (defgeneric.fun.7)) |
168 |
|
(multiple-value-list (apply fn nil)))) |
169 |
|
t t (a) (a) (a)) |
170 |
|
|