This ns is mostly just for documentation and for providing an alias.
Defines standard keyword keys used in the implementations ('impls') map of a persistent PolyMap to override default map behaviors.
Each var defined here holds the actual namespaced keyword as its value
(e.g., get_k
evaluates to ::get_k
in this ns). The documentation for
the override is attached as metadata to the var.
Override functions associated with these keywords receive the following arguments:
Override functions are generally expected to return the final result
that the corresponding Clojure interface method would return (e.g., a new
PolyMap instance for assoc/dissoc, a value for get, a boolean for containsKey?).
When returning a new PolyMap instance, ensure it's properly constructed,
often using com.jolygon.poly-map.api-0/make-poly-map
or similar internal
constructors if needed, preserving implementations and metadata appropriately.
This ns is mostly just for documentation and for providing an alias. Defines standard keyword keys used in the implementations ('impls') map of a persistent PolyMap to override default map behaviors. Each var defined here holds the actual namespaced keyword as its value (e.g., `get_k` evaluates to `::get_k` in this ns). The documentation for the override is attached as metadata to the var. Override functions associated with these keywords receive the following arguments: - this The PolyMap instance itself. - m The underlying persistent data collection. - impls The persistent implementations map itself. - metadata The persistent metadata map of the PolyMap instance. Followed by operation-specific arguments like k, v, f, init, etc. Override functions are generally expected to return the final result that the corresponding Clojure interface method would return (e.g., a new PolyMap instance for assoc/dissoc, a value for get, a boolean for containsKey?). When returning a new PolyMap instance, ensure it's properly constructed, often using `com.jolygon.poly-map.api-0/make-poly-map` or similar internal constructors if needed, preserving implementations and metadata appropriately.
(assoc_k_v this m impls metadata k v)
Overrides clojure.lang.Associative/assoc
.
Expected fn signature: (fn [this m impls metadata k v] ...)
Should return: The new persistent PolyMap instance with the key/value associated.
Overrides `clojure.lang.Associative/assoc`. Expected fn signature: `(fn [this m impls metadata k v] ...)` Should return: The new persistent PolyMap instance with the key/value associated.
(assocEx_k_v this m impls metadata k v)
Overrides clojure.lang.IPersistentMap/assocEx
.
Note: Maps typically treat assocEx like assoc (no exception on existing key).
Expected fn signature: (fn [this m impls metadata k v] ...)
Should return: The new persistent PolyMap instance with the key/value associated.
Overrides `clojure.lang.IPersistentMap/assocEx`. Note: Maps typically treat assocEx like assoc (no exception on existing key). Expected fn signature: `(fn [this m impls metadata k v] ...)` Should return: The new persistent PolyMap instance with the key/value associated.
(asTransient this m impls metadata)
Overrides clojure.lang.IEditableCollection/asTransient
(CLJ) or IEditableCollection.-as-transient
(CLJS).
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A new TransientPolyMap
instance.
Overrides `clojure.lang.IEditableCollection/asTransient` (CLJ) or `IEditableCollection.-as-transient` (CLJS). Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A new `TransientPolyMap` instance.
(CLJ only) Overrides java.util.Map/clear
. Unsupported on immutable maps.
(CLJ only) Overrides `java.util.Map/clear`. Unsupported on immutable maps.
(coll-reduce_f this m impls metadata f)
Overrides clojure.core.protocols/coll-reduce
(1-arg arity: (reduce f coll)
).
Expected fn signature: (fn [this m impls metadata f] ...)
where f
is the reducing function.
Should return: The final reduced value.
Overrides `clojure.core.protocols/coll-reduce` (1-arg arity: `(reduce f coll)`). Expected fn signature: `(fn [this m impls metadata f] ...)` where `f` is the reducing function. Should return: The final reduced value.
(coll-reduce_f_init this m impls metadata f init)
Overrides clojure.core.protocols/coll-reduce
(2-arg arity: (reduce f init coll)
).
Expected fn signature: (fn [this m impls metadata f init] ...)
where f
is reducing fn, init
is initial value.
Should return: The final reduced value.
Overrides `clojure.core.protocols/coll-reduce` (2-arg arity: `(reduce f init coll)`). Expected fn signature: `(fn [this m impls metadata f init] ...)` where `f` is reducing fn, `init` is initial value. Should return: The final reduced value.
(cons_v this m impls metadata v)
Overrides clojure.lang.IPersistentCollection/cons
.
Expected fn signature: (fn [this m impls metadata v] ...)
where v
is the value to add (e.g., a MapEntry).
Should return: The new persistent PolyMap instance with the item added.
Overrides `clojure.lang.IPersistentCollection/cons`. Expected fn signature: `(fn [this m impls metadata v] ...)` where `v` is the value to add (e.g., a MapEntry). Should return: The new persistent PolyMap instance with the item added.
(construct this m impls metadata)
Internal function called when creating/updating PolyMap instances. Applies ::pm/construct hook if present. Returns a PolyMap.
Internal function called when creating/updating PolyMap instances. Applies ::pm/construct hook if present. Returns a PolyMap.
(containsKey_k this m impls metadata k)
Overrides clojure.lang.Associative/containsKey
.
Expected fn signature: (fn [this m impls metadata k] ...)
Should return: Boolean indicating if the key k
is present.
Overrides `clojure.lang.Associative/containsKey`. Expected fn signature: `(fn [this m impls metadata k] ...)` Should return: Boolean indicating if the key `k` is present.
(CLJ only) Overrides java.util.Map/containsValue
. Often inefficient.
(CLJ only) Overrides `java.util.Map/containsValue`. Often inefficient.
(count this m impls metadata)
Overrides clojure.lang.Counted/count
.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: The integer count of items in the map.
Overrides `clojure.lang.Counted/count`. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: The integer count of items in the map.
(empty this m impls metadata)
Overrides clojure.lang.IPersistentCollection/empty
.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A new, empty PolyMap instance (typically keeping the same impls map and nil metadata).
Overrides `clojure.lang.IPersistentCollection/empty`. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A new, empty PolyMap instance (typically keeping the same impls map and nil metadata).
(entryAt_k this m impls metadata k)
Overrides clojure.lang.Associative/entryAt
.
Expected fn signature: (fn [this m impls metadata k] ...)
Should return: A clojure.lang.MapEntry
for the key k
, or nil.
Overrides `clojure.lang.Associative/entryAt`. Expected fn signature: `(fn [this m impls metadata k] ...)` Should return: A `clojure.lang.MapEntry` for the key `k`, or nil.
(CLJ only) Overrides java.util.Map/entrySet
.
(CLJ only) Overrides `java.util.Map/entrySet`.
(equiv_other this m impls metadata other)
Overrides clojure.lang.IHashEq/equiv
(CLJ) or IEquiv.-equiv
(CLJS).
Note: Default PolyMap equiv delegates to underlying value. Overriding this changes equality semantics. Be cautious.
Expected fn signature: (fn [this m impls metadata other] ...)
where other
is the object to compare against.
Should return: Boolean indicating equivalence.
Overrides `clojure.lang.IHashEq/equiv` (CLJ) or `IEquiv.-equiv` (CLJS). Note: Default PolyMap equiv delegates to underlying value. Overriding this changes equality semantics. Be cautious. Expected fn signature: `(fn [this m impls metadata other] ...)` where `other` is the object to compare against. Should return: Boolean indicating equivalence.
(get_k this m impls metadata k)
Overrides clojure.lang.ILookup/valAt
(get with 1 key argument).
Expected fn signature: (fn [this m impls metadata k] ...)
Should return: The value associated with k
, or nil if not found.
Overrides `clojure.lang.ILookup/valAt` (get with 1 key argument). Expected fn signature: `(fn [this m impls metadata k] ...)` Should return: The value associated with `k`, or nil if not found.
(get_k_nf this m impls metadata k nf)
Overrides clojure.lang.ILookup/valAt
(get with key and nf arguments).
Expected fn signature: (fn [this m impls metadata k nf] ...)
Should return: The value associated with k
, or the nf
value.
Overrides `clojure.lang.ILookup/valAt` (get with key and nf arguments). Expected fn signature: `(fn [this m impls metadata k nf] ...)` Should return: The value associated with `k`, or the `nf` value.
(handle-invoke this env impls metadata)
(handle-invoke this env impls metadata a1)
(handle-invoke this env impls metadata a1 a2)
(handle-invoke this env impls metadata a1 a2 a3)
(handle-invoke this env impls metadata a1 a2 a3 a4)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6 a7)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6 a7 a8)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6 a7 a8 a9)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6 a7 a8 a9 a10)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11)
(handle-invoke this env impls metadata a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12)
(handle-invoke this
env
impls
metadata
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13)
(handle-invoke this
env
impls
metadata
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13
a14)
(handle-invoke this
env
impls
metadata
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13
a14
a15)
(handle-invoke this
env
impls
metadata
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13
a14
a15
a16)
(handle-invoke this
env
impls
metadata
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13
a14
a15
a16
&
rest-args)
Core IFn invocation handler for PolyMap instances. Checks for ::invoke-variadic in impls and calls it if present with exact arity arguments (0-20). Otherwise delegates to default-map-invoke with exact arity arguments. Uses apply only for arity > 20.
Core IFn invocation handler for PolyMap instances. Checks for ::invoke-variadic in impls and calls it if present with exact arity arguments (0-20). Otherwise delegates to default-map-invoke with exact arity arguments. Uses apply only for arity > 20.
(hashCode this m impls metadata)
Overrides Object/hashCode
(CLJ) or IHash.-hash
(CLJS).
Note: Must be consistent with equiv_other
if overridden. Default delegates to m.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: An integer hash code.
Overrides `Object/hashCode` (CLJ) or `IHash.-hash` (CLJS). Note: Must be consistent with `equiv_other` if overridden. Default delegates to m. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: An integer hash code.
(invoke-variadic this m impls metadata & args)
Overrides clojure.lang.IFn/invoke
and applyTo
. Called when the PolyMap is invoked as a function.
Note: The default implementation handles arities 1 & 2 as map lookups.
This override replaces ALL function call behavior.
Expected fn signature: (fn [this m impls metadata & args] ...)
Should return: The result of the function call.
Overrides `clojure.lang.IFn/invoke` and `applyTo`. Called when the PolyMap is invoked as a function. Note: The default implementation handles arities 1 & 2 as map lookups. This override replaces ALL function call behavior. Expected fn signature: `(fn [this m impls metadata & args] ...)` Should return: The result of the function call.
Protocol for managing the impls map ('m') of a persistent PolyMap.
Protocol for managing the impls map ('m') of a persistent PolyMap.
(-assoc-impl coll k v)
Associates impl k with function v in the impls map. Returns new PolyMap.
Associates impl k with function v in the impls map. Returns new PolyMap.
(-contains-impl? coll k)
Returns true if impl k exists in the impls map.
Returns true if impl k exists in the impls map.
(-dissoc-impl coll k)
Removes impl k from the impls map. Returns new PolyMap.
Removes impl k from the impls map. Returns new PolyMap.
(-get-coll coll)
Returns the underlying persistent data collection ('m').
Returns the underlying persistent data collection ('m').
(-get-impls coll)
Returns the full persistent impls map.
Returns the full persistent impls map.
(-impl coll k)
Returns the function associated with impl k, or nil.
Returns the function associated with impl k, or nil.
(-set-impls coll new-impls)
Replaces the entire impls map. Returns new PolyMap.
Replaces the entire impls map. Returns new PolyMap.
(CLJ only) Overrides java.util.Map/isEmpty
. See count
or seq
.
(CLJ only) Overrides `java.util.Map/isEmpty`. See `count` or `seq`.
(iterator this m impls metadata)
Overrides java.lang.Iterable/iterator
(CLJ) or IIterable.-iterator
(CLJS).
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A relevant Iterator object over the map's entries.
Overrides `java.lang.Iterable/iterator` (CLJ) or `IIterable.-iterator` (CLJS). Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A relevant Iterator object over the map's entries.
(keyIterator this m impls metadata)
Overrides clojure.lang.IMapIterable/keyIterator
(CLJ only?).
Note: Less commonly overridden than seq/reduce.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A java.util.Iterator
over the map's keys.
Overrides `clojure.lang.IMapIterable/keyIterator` (CLJ only?). Note: Less commonly overridden than seq/reduce. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A `java.util.Iterator` over the map's keys.
(CLJ only) Overrides java.util.Map/keySet
.
(CLJ only) Overrides `java.util.Map/keySet`.
(kv-reduce_f_init this m impls metadata f init)
Overrides clojure.lang.IKVReduce/kvreduce
(CLJ) or cljs.core.protocols/IKVReduce.-kv-reduce
(CLJS).
Expected fn signature: (fn [this m impls metadata f init] ...)
where f
is (fn [acc k v] ...)
reducing fn.
Should return: The final reduced value.
Overrides `clojure.lang.IKVReduce/kvreduce` (CLJ) or `cljs.core.protocols/IKVReduce.-kv-reduce` (CLJS). Expected fn signature: `(fn [this m impls metadata f init] ...)` where `f` is `(fn [acc k v] ...)` reducing fn. Should return: The final reduced value.
(meta this m impls metadata)
Overrides clojure.lang.IObj/meta
(CLJ) or IMeta.-meta
(CLJS).
Expected fn signature: (fn [this m impls metadata] ...)
Should return: The metadata map associated with the PolyMap.
Overrides `clojure.lang.IObj/meta` (CLJ) or `IMeta.-meta` (CLJS). Expected fn signature: `(fn [this m impls metadata] ...)` Should return: The metadata map associated with the PolyMap.
(print-method_writer this m impls metadata writer)
Overrides the print-method
multimethod (CLJ) or IPrintWithWriter.-pr-writer
protocol method (CLJS).
Expected fn signature: (fn [this m impls metadata writer] ...)
where writer
is the output writer/stream. CLJS also receives opts
.
Should return: nil
(CLJ) or the writer (CLJS). The function should perform writes to the writer directly.
Overrides the `print-method` multimethod (CLJ) or `IPrintWithWriter.-pr-writer` protocol method (CLJS). Expected fn signature: `(fn [this m impls metadata writer] ...)` where `writer` is the output writer/stream. CLJS also receives `opts`. Should return: `nil` (CLJ) or the writer (CLJS). The function should perform writes to the writer directly.
(CLJ only) Overrides java.util.Map/put
. Unsupported on immutable maps.
(CLJ only) Overrides `java.util.Map/put`. Unsupported on immutable maps.
(CLJ only) Overrides java.util.Map/putAll
. Unsupported on immutable maps.
(CLJ only) Overrides `java.util.Map/putAll`. Unsupported on immutable maps.
(CLJ only) Overrides java.util.Map/remove
. Unsupported on immutable maps.
(CLJ only) Overrides `java.util.Map/remove`. Unsupported on immutable maps.
(seq this m impls metadata)
Overrides clojure.lang.Seqable/seq
.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A seq of the map's entries, or nil if empty.
Overrides `clojure.lang.Seqable/seq`. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A seq of the map's entries, or nil if empty.
(CLJ only) Overrides java.util.Map/size
. See count
.
(CLJ only) Overrides `java.util.Map/size`. See `count`.
(toString this m impls metadata)
Overrides Object/toString
.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A string representation of the PolyMap.
Overrides `Object/toString`. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A string representation of the PolyMap.
(valIterator this m impls metadata)
Overrides clojure.lang.IMapIterable/valIterator
(CLJ only?).
Note: Less commonly overridden than seq/reduce.
Expected fn signature: (fn [this m impls metadata] ...)
Should return: A java.util.Iterator
over the map's values.
Overrides `clojure.lang.IMapIterable/valIterator` (CLJ only?). Note: Less commonly overridden than seq/reduce. Expected fn signature: `(fn [this m impls metadata] ...)` Should return: A `java.util.Iterator` over the map's values.
(CLJ only) Overrides java.util.Map/values
.
(CLJ only) Overrides `java.util.Map/values`.
(withMeta_meta this m impls metadata new-meta)
Overrides clojure.lang.IObj/withMeta
(CLJ) or IWithMeta.-with-meta
(CLJS).
Expected fn signature: (fn [this m impls metadata new-meta] ...)
where new-meta
is the new metadata map.
Should return: A new persistent PolyMap instance with the new metadata applied.
Overrides `clojure.lang.IObj/withMeta` (CLJ) or `IWithMeta.-with-meta` (CLJS). Expected fn signature: `(fn [this m impls metadata new-meta] ...)` where `new-meta` is the new metadata map. Should return: A new persistent PolyMap instance with the new metadata applied.
(without_k this m impls metadata k)
Overrides clojure.lang.IPersistentMap/without
(dissoc).
Note: Core dissoc is variadic. This override receives only the first key k
.
Expected fn signature: (fn [this m impls metadata k] ...)
Should return: The new persistent PolyMap instance with the key removed.
Overrides `clojure.lang.IPersistentMap/without` (dissoc). Note: Core dissoc is variadic. This override receives only the first key `k`. Expected fn signature: `(fn [this m impls metadata k] ...)` Should return: The new persistent PolyMap instance with the key removed.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close