git » jacl.git » commit 7c324d6

multimethod

author Alan Dipert
2019-10-16 14:48:46 UTC
committer Alan Dipert
2019-10-16 14:48:46 UTC
parent 58216b99c618e12a6b01dc61a3f69f232c78fc5e

multimethod

index.html +2 -1
multimethod.js +1 -1

diff --git a/index.html b/index.html
index 1fb1f73..1c905dd 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
     <link rel="stylesheet" href="qunit-2.9.2.css">
     <style type="text/css">
     @media (prefers-color-scheme: dark) {
-      body { 
+      body {
         color: #ddd;
         background-color: black;
       }
@@ -18,6 +18,7 @@
     <div id="qunit"></div>
     <div id="qunit-fixture"></div>
     <script src="qunit-2.9.2.js"></script>
+    <script src="multimethod.js"></script>
     <script src="jacl.js"></script>
     <script src="jacl-tests.js"></script>
   </body>
diff --git a/multimethod.js b/multimethod.js
index 77f468e..4831a9f 100644
--- a/multimethod.js
+++ b/multimethod.js
@@ -123,7 +123,7 @@
 //       return this.recur(n-1, b, a+b);
 //     });
 function multimethod(dispatch = (firstArg) => firstArg,
-                     test = equal,
+                     test = (x, y) => x === y,
                      defaultMethod = null,
                      methods = []) {