type specifier '(simple-vector n) in defmethod
Taoufik Dachraoui <[email protected]> Tue, 2 Jan 2024 12:14:24 +0100
| Newsgroups | gmane.lisp.openmcl.devel |
|---|---|
| Message-ID | <CA+2r5MHmTkpHrJrKyvfGOgaLOqTZFtf6DExga_3GOYgQ1UdRPQ@mail.gmail.com> |
Hi
I am trying to use '(simple-vector n) as type specifier in defmethod but it
is not possible, is there another way?
(typep #(1 2 3 4) '(simple-vector 4))
(defmethod mul ((n fixnum) (m1 (simple-vector n)) (m2 (simple-vector n)))
(let ((r (make-array (list n))))
(dotimes (i n)
(setf (svref r i) (* (svref m1 i) (svref m2 i))))
r))
Kind regards
Taoufik Dachraoui