We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TODO:
In defprotocol/reify/defrecord there's this syntax for multi-arity methods:
(deftype Foo [a b c] P (foo [x] a) (bar-me [x] b) (bar-me [x y] (+ c y)))
whereas extend-type has this:
(extend-type MyType Countable (cnt [c] ...) Foo (bar [x y] ...) (baz ([x] ...) ([x y zs] ...))) What's the official syntax? (edited)
Example:
user=> (defprotocol IFruit (subtotal [item] [item subtotal])) IFruit user=> (defrecord Apple [price] IFruit (subtotal [_] price) (subtotal [_ discount] (- price discount))) user.Apple user=> (subtotal (->Apple 100)) 100 user=> (subtotal (->Apple 100) 5) 95
Also see #401
The text was updated successfully, but these errors were encountered:
[#406] Tests for multi-arity protocols
af176c0
[#406] Tests for multi-arity multimethods
82c7d9c
[#406] Tests for multi-arity protocols and multimethods
b0e7d64
No branches or pull requests
TODO:
In defprotocol/reify/defrecord there's this syntax for multi-arity methods:
whereas extend-type has this:
Example:
Also see #401
The text was updated successfully, but these errors were encountered: