46 |
(t |
(t |
47 |
(setq type (normalize-type type)) |
(setq type (normalize-type type)) |
48 |
(when (subtypep (car type) 'list) |
(when (subtypep (car type) 'list) |
49 |
(if (and (eq 'null (car type)) (not (equal size 0))) |
(if (or (and (eq 'null (car type)) (not (equal size 0))) |
50 |
(error "Cannot make 'null sequence of size ~S." size)) |
(and (eq 'cons (car type)) (equal size 0))) |
51 |
|
(specific-error :wrong-type-argument "~S is not of type ~S." |
52 |
|
type (format nil "list (size ~S)" size))) |
53 |
(return-from make-sequence |
(return-from make-sequence |
54 |
(if iesp |
(if iesp |
55 |
(make-list size :initial-element initial-element) |
(make-list size :initial-element initial-element) |
56 |
(make-list size)))) |
(make-list size)))) |
57 |
(unless (or (eq (car type) 'array) |
(unless (or (eq (car type) 'array) |
58 |
(eq (car type) 'simple-array)) |
(eq (car type) 'simple-array)) |
59 |
(error "~S is not a sequence type." type)) |
(specific-error :wrong-type-argument "~S is not of type ~S." |
60 |
|
type "sequence")) |
61 |
(unless (or (not (si::fixnump (car (caddr type)))) |
(unless (or (not (si::fixnump (car (caddr type)))) |
62 |
(equal (car (caddr type)) size)) |
(equal (car (caddr type)) size)) |
63 |
(error "Cannot make-sequence of type ~S and size ~S." type size)) |
(specific-error :wrong-type-argument "~S is not of type ~S." |
64 |
|
type (format nil "~S (size ~S)" type size))) |
65 |
(or (cadr type) t)))) |
(or (cadr type) t)))) |
66 |
(setq element-type (si::best-array-element-type element-type)) |
(setq element-type (si::best-array-element-type element-type)) |
67 |
(setq sequence (si:make-vector element-type size nil nil nil nil nil)) |
(setq sequence (si:make-vector element-type size nil nil nil nil nil)) |