[Openmcl-devel] type specifier '(simple-vector n) in defmethod

Michał "phoe" Herda phoe at disroot.org
Tue Jan 2 03:16:57 PST 2024


No, standard CLOS dispatch happens only on classes.

Have you tried https://github.com/digikar99/polymorphic-functions ?

W dniu 2024-01-02 12:14, Taoufik Dachraoui napisał(a):

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20240102/36ce47f8/attachment.htm>


More information about the Openmcl-devel mailing list