Back
kv-reduce (clj)
(source)protocol
(kv-reduce amap f init)
Examples
babashka/babashka
(ns babashka.impl.protocols
(:require [babashka.impl.protocols :as protocols]
[clojure.core.protocols :as p]
[clojure.datafy :as d]
;; ensure datafy is loaded, we're going to override its
;; clojure.lang.Namespace implementation for datafy
[clojure.reflect]
[sci.core :as sci :refer [copy-var]]
[sci.impl.types :as types]
[sci.impl.vars]))
;; IKVReduce only added for satisies? check for now. We can implement
;; kv-reduce in the future, but this needs patching some functions like
;; update-vals, etc.
'IKVReduce (sci/new-var 'clojure.core.protocols/IKVReduce {:protocol p/IKVReduce
;; :methods #{'kv-reduce}
:ns protocols-ns}
{:ns protocols-ns})
;; 'kv-reduce (copy-var kv-reduce protocols-ns)
}
)
jonase/eastwood
(ns testcases.unusednss3
(:require [clojure.core.protocols :as protocols]
[clojure.core.reducers :as reducers]
[clojure.data :as data]
[clojure.java.io :as io]
[clojure.reflect :as reflect]))
(extend String
protocols/IKVReduce
{:kv-reduce (fn [amap f init] nil)})