Map type extensions (#749)
This commit is contained in:
parent
9e1cb2f9de
commit
2ad4d3342c
2 changed files with 93 additions and 33 deletions
|
|
@ -252,6 +252,7 @@
|
||||||
:instance-checks [clojure.lang.Associative
|
:instance-checks [clojure.lang.Associative
|
||||||
clojure.lang.Atom
|
clojure.lang.Atom
|
||||||
clojure.lang.Cons
|
clojure.lang.Cons
|
||||||
|
clojure.lang.Counted
|
||||||
clojure.lang.Cycle
|
clojure.lang.Cycle
|
||||||
clojure.lang.IObj
|
clojure.lang.IObj
|
||||||
clojure.lang.Fn ;; to distinguish fns from maps, etc.
|
clojure.lang.Fn ;; to distinguish fns from maps, etc.
|
||||||
|
|
@ -261,14 +262,20 @@
|
||||||
;; clojure.lang.IAtom ;; implemented as protocol in sci
|
;; clojure.lang.IAtom ;; implemented as protocol in sci
|
||||||
clojure.lang.IEditableCollection
|
clojure.lang.IEditableCollection
|
||||||
clojure.lang.IMapEntry
|
clojure.lang.IMapEntry
|
||||||
|
clojure.lang.IMeta
|
||||||
clojure.lang.ILookup
|
clojure.lang.ILookup
|
||||||
clojure.lang.IPersistentCollection
|
clojure.lang.IPersistentCollection
|
||||||
clojure.lang.IPersistentMap
|
clojure.lang.IPersistentMap
|
||||||
clojure.lang.IPersistentSet
|
clojure.lang.IPersistentSet
|
||||||
|
clojure.lang.IPersistentStack
|
||||||
clojure.lang.IPersistentVector
|
clojure.lang.IPersistentVector
|
||||||
clojure.lang.IRecord
|
clojure.lang.IRecord
|
||||||
|
clojure.lang.IReduce
|
||||||
|
clojure.lang.IReduceInit
|
||||||
|
clojure.lang.IKVReduce
|
||||||
clojure.lang.IRef
|
clojure.lang.IRef
|
||||||
clojure.lang.ISeq
|
clojure.lang.ISeq
|
||||||
|
clojure.lang.Indexed
|
||||||
clojure.lang.Iterate
|
clojure.lang.Iterate
|
||||||
clojure.lang.LazySeq
|
clojure.lang.LazySeq
|
||||||
clojure.lang.Named
|
clojure.lang.Named
|
||||||
|
|
@ -284,11 +291,13 @@
|
||||||
clojure.lang.PersistentVector
|
clojure.lang.PersistentVector
|
||||||
clojure.lang.Ratio
|
clojure.lang.Ratio
|
||||||
clojure.lang.Repeat
|
clojure.lang.Repeat
|
||||||
|
clojure.lang.Reversible
|
||||||
clojure.lang.Symbol
|
clojure.lang.Symbol
|
||||||
clojure.lang.Sequential
|
clojure.lang.Sequential
|
||||||
clojure.lang.Seqable
|
clojure.lang.Seqable
|
||||||
clojure.lang.Volatile
|
clojure.lang.Volatile
|
||||||
java.util.List]
|
java.util.List
|
||||||
|
java.util.Iterator]
|
||||||
:custom ~custom-map})
|
:custom ~custom-map})
|
||||||
|
|
||||||
(defmacro gen-class-map []
|
(defmacro gen-class-map []
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,27 @@
|
||||||
#_:clj-kondo/ignore
|
#_:clj-kondo/ignore
|
||||||
(def reify-fn
|
(def reify-fn
|
||||||
(gen-reify-combos
|
(gen-reify-combos
|
||||||
{clojure.lang.Associative {containsKey [[this k]]
|
{java.nio.file.FileVisitor
|
||||||
|
{preVisitDirectory [[this p attrs]]
|
||||||
|
postVisitDirectory [[this p attrs]]
|
||||||
|
visitFile [[this p attrs]]}
|
||||||
|
|
||||||
|
java.io.FileFilter
|
||||||
|
{accept [[this f]]}
|
||||||
|
|
||||||
|
java.io.FilenameFilter
|
||||||
|
{accept [[this f s]]}
|
||||||
|
|
||||||
|
clojure.lang.Associative
|
||||||
|
{containsKey [[this k]]
|
||||||
entryAt [[this k]]
|
entryAt [[this k]]
|
||||||
assoc [[this k v]]}
|
assoc [[this k v]]}
|
||||||
clojure.lang.ILookup {valAt [[this k] [this k default]]}
|
|
||||||
clojure.lang.IFn {applyTo [[this arglist]]
|
clojure.lang.ILookup
|
||||||
|
{valAt [[this k] [this k default]]}
|
||||||
|
|
||||||
|
clojure.lang.IFn
|
||||||
|
{applyTo [[this arglist]]
|
||||||
invoke [[this]
|
invoke [[this]
|
||||||
[this a1]
|
[this a1]
|
||||||
[this a1 a2]
|
[this a1 a2]
|
||||||
|
|
@ -70,8 +86,43 @@
|
||||||
[this a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19]
|
[this a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19]
|
||||||
[this a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20]
|
[this a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20]
|
||||||
[this a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 varargs]]}
|
[this a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 varargs]]}
|
||||||
java.nio.file.FileVisitor {preVisitDirectory [[this p attrs]]
|
|
||||||
postVisitDirectory [[this p attrs]]
|
clojure.lang.IPersistentCollection
|
||||||
visitFile [[this p attrs]]}
|
{count [[this]]
|
||||||
java.io.FileFilter {accept [[this f]]}
|
cons [[this x]]
|
||||||
java.io.FilenameFilter {accept [[this f s]]}}))
|
empty [[this]]
|
||||||
|
equiv [[this x]]}
|
||||||
|
|
||||||
|
clojure.lang.IReduce
|
||||||
|
{reduce [[this f]]}
|
||||||
|
|
||||||
|
clojure.lang.IReduceInit
|
||||||
|
{reduce [[this f initial]]}
|
||||||
|
|
||||||
|
clojure.lang.IKVReduce
|
||||||
|
{kvreduce [[this f initial]]}
|
||||||
|
|
||||||
|
clojure.lang.Indexed
|
||||||
|
{nth [[this n] [this n not-found]]}
|
||||||
|
|
||||||
|
clojure.lang.IPersistentMap
|
||||||
|
{assocEx [[this k v]]
|
||||||
|
without [[this k]]}
|
||||||
|
|
||||||
|
clojure.lang.IPersistentStack
|
||||||
|
{peek [[this]]
|
||||||
|
pop [[this]]}
|
||||||
|
|
||||||
|
clojure.lang.Reversible
|
||||||
|
{rseq [[this]]}
|
||||||
|
|
||||||
|
clojure.lang.Seqable
|
||||||
|
{seq [[this]]}
|
||||||
|
|
||||||
|
java.lang.Iterable
|
||||||
|
{iterator [[this]]
|
||||||
|
forEach [[this action]]}
|
||||||
|
|
||||||
|
java.util.Iterator
|
||||||
|
{hasNext [[this]]
|
||||||
|
next [[this]]}}))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue