123 |
(let ((a (make-array 6 :initial-element 'x |
(let ((a (make-array 6 :initial-element 'x |
124 |
:fill-pointer 3))) |
:fill-pointer 3))) |
125 |
(map-into a #'identity '(1 2 3 4 5)) |
(map-into a #'identity '(1 2 3 4 5)) |
126 |
a) |
(and (eqlt (fill-pointer a) 5) |
127 |
|
a)) |
128 |
#(1 2 3 4 5)) |
#(1 2 3 4 5)) |
129 |
|
|
130 |
(deftest map-into-array.10 |
(deftest map-into-array.10 |
131 |
(let ((a (make-array 6 :initial-element 'x |
(let ((a (make-array 6 :initial-element 'x |
132 |
:fill-pointer 3))) |
:fill-pointer 3))) |
133 |
(map-into a #'(lambda () 'y)) |
(map-into a #'(lambda () 'y)) |
134 |
a) |
(and (eqlt (fill-pointer a) 6) |
135 |
|
a)) |
136 |
#(y y y y y y)) |
#(y y y y y y)) |
137 |
|
|
138 |
;;; mapping into strings |
;;; mapping into strings |
158 |
t |
t |
159 |
"1234") |
"1234") |
160 |
|
|
161 |
|
(deftest map-into-string.4 |
162 |
|
(let ((a (make-array 6 :initial-element #\x |
163 |
|
:element-type 'character |
164 |
|
:fill-pointer 3))) |
165 |
|
(map-into a #'identity "abcde") |
166 |
|
(values |
167 |
|
(fill-pointer a) |
168 |
|
(aref a 5) |
169 |
|
a)) |
170 |
|
5 |
171 |
|
#\x |
172 |
|
"abcde") |
173 |
|
|
174 |
|
(deftest map-into-string.5 |
175 |
|
(let ((a (make-array 6 :initial-element #\x |
176 |
|
:element-type 'character |
177 |
|
:fill-pointer 3))) |
178 |
|
(map-into a #'(lambda () #\y)) |
179 |
|
(values (fill-pointer a) |
180 |
|
a)) |
181 |
|
6 |
182 |
|
"yyyyyy") |
183 |
|
|
184 |
|
(deftest map-into-string.6 |
185 |
|
(let ((a (make-array 6 :initial-element #\x |
186 |
|
:element-type 'character))) |
187 |
|
(map-into a #'(lambda () #\y)) |
188 |
|
a) |
189 |
|
"yyyyyy") |
190 |
|
|
191 |
|
(deftest map-into-string.7 |
192 |
|
(let ((a (make-array 6 :initial-element #\x |
193 |
|
:element-type 'base-char |
194 |
|
:fill-pointer 3))) |
195 |
|
(map-into a #'identity "abcde") |
196 |
|
(values (fill-pointer a) |
197 |
|
(aref a 5) |
198 |
|
a)) |
199 |
|
5 |
200 |
|
#\x |
201 |
|
"abcde") |
202 |
|
|
203 |
|
(deftest map-into-string.8 |
204 |
|
(let ((a (make-array 6 :initial-element #\x |
205 |
|
:element-type 'base-char |
206 |
|
:fill-pointer 3))) |
207 |
|
(map-into a #'(lambda () #\y)) |
208 |
|
(values (fill-pointer a) |
209 |
|
a)) |
210 |
|
6 |
211 |
|
"yyyyyy") |
212 |
|
|
213 |
|
(deftest map-into-string.9 |
214 |
|
(let ((a (make-array 6 :initial-element #\x |
215 |
|
:element-type 'base-char))) |
216 |
|
(map-into a #'(lambda () #\y)) |
217 |
|
a) |
218 |
|
"yyyyyy") |
219 |
|
|
220 |
(deftest map-into-error.1 |
(deftest map-into-error.1 |
221 |
(classify-error (map-into 'a #'(lambda () nil))) |
(classify-error (map-into 'a #'(lambda () nil))) |
222 |
type-error) |
type-error) |
228 |
(deftest map-into-error.3 |
(deftest map-into-error.3 |
229 |
(classify-error (map-into (copy-seq '(a b c)) #'cons '(d e f) 100)) |
(classify-error (map-into (copy-seq '(a b c)) #'cons '(d e f) 100)) |
230 |
type-error) |
type-error) |
231 |
|
|