Provides a variant of clojure.core/satisfies?
that also checks if a value implements all methods in the protocol.
Available on Clojars.
Leiningen:
[io.github.frenchy64/fully-satisfies "1.1.0"]
Clojure CLI:
:deps {io.github.frenchy64/fully-satisfies
{:git/tag "1.1.0", :git/sha "42b2488"}}
Try it in a REPL:
clj -Sdeps \
'{:deps
{io.github.frenchy64/fully-satisfies
{:git/tag "1.1.0"
:git/sha "42b2488"}}}'
;; See usage below for how to proceed
(require '[io.github.frenchy64.fully-satisfies :refer [fully-satisfies?]])
(defprotocol A
(a [this])
(b [this]))
(fully-satisfies? A (reify))
;=> false
(fully-satisfies? A (reify A))
;=> false
(fully-satisfies? A (reify A (a [this])))
;=> false
(fully-satisfies? A (reify A (a [this]) (b [this])))
;=> true
1.0.0-SNAPSHOT
Release {:major,:minor,:patch}
{:major,:minor,:patch}
SNAPSHOTREADME.md
Thanks Wanderson Ferreira for the idea and name. My initial stance that this was impossible to implement quickly proved to be incorrect after Wanderson's asked the right questions and decompiled some bytecode.
Wanderson and Mark Herman, II also helped improve early iterations.
supers
call is suspiciousCopyright © 2021 Ambrose Bonnaire-Sergeant
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close