<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
To which, (at the risk of a civilized flame war), I say, "too bad."<br>
IMHO, this was a short-sighted and poor design decision by the X3J13
committee, <i>et al</i>.<br>
The same debate came up within the greater Java community, <br>
and it is one place where Java and C# diverged.<br>
Java's designers made similar choices to Common Lisp's: <br>
two kinds of datatypes, dispatchable objects and everything else.<br>
C# is arguably "Java done right," where <i>everything</i> is a
dispatchable "object."<br>
<br>
There are clear benefits: it would also result in a cleaner, more
appealing, more powerful language.<br>
It's not too late to fix this flaw. What's the harm? <br>
The "non-object" dispatch code would only be present in generic
functions when necessary.<br>
<br>
--Tim<br>
<br>
<div class="moz-cite-prefix">On 1/2/24 6:17 AM, Michał "phoe" Herda
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:5a6500c0585e1ab4a1eb0530ee655fbf@disroot.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>No, standard CLOS dispatch happens only on classes.</p>
<p>Have you tried <a
href="https://github.com/digikar99/polymorphic-functions"
target="_blank" rel="noopener noreferrer"
moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/digikar99/polymorphic-functions</a>
?</p>
<p id="reply-intro">W dniu 2024-01-02 12:14, Taoufik Dachraoui
napisał(a):</p>
<blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">Hi
<div> </div>
<div>I am trying to use '(simple-vector n) as type specifier
in defmethod but it is not possible, is there another way?<br>
<br>
(typep #(1 2 3 4) '(simple-vector 4))<br>
<br>
(defmethod mul ((n fixnum) (m1 (simple-vector n)) (m2
(simple-vector n)))<br>
(let ((r (make-array (list n))))<br>
(dotimes (i n)<br>
(setf (svref r i) (* (svref m1 i) (svref m2 i))))<br>
r))<br>
<div> </div>
Kind regards<br>
<div class="v1gmail_signature" dir="ltr">
<div dir="ltr">Taoufik Dachraoui
<div> </div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
</blockquote>
<br>
</body>
</html>