package com.github.rschmitt.dynamicobject;

import clojure.lang.IFn;

import static clojure.java.api.Clojure.read;
import static clojure.java.api.Clojure.var;

class ClojureStuff {
    static final Object EmptyMap = read("{}");
    static final Object EmptySet = read("#{}");
    static final Object EmptyVector = read("[]");
    static final Object Type = read(":type");
    static final Object Readers = read(":readers");
    static final Object Default = read(":default");

    static final IFn Assoc = var("clojure.core", "assoc");
    static final IFn AssocBang = var("clojure.core", "assoc!");
    static final IFn Bigint = var("clojure.core", "bigint");
    static final IFn Biginteger = var("clojure.core", "biginteger");
    static final IFn ConjBang = var("clojure.core", "conj!");
    static final IFn Deref = var("clojure.core", "deref");
    static final IFn Dissoc = var("clojure.core", "dissoc");
    static final IFn Eval = var("clojure.core", "eval");
    static final IFn Get = var("clojure.core", "get");
    static final IFn Memoize = var("clojure.core", "memoize");
    static final IFn MergeWith = var("clojure.core", "merge-with");
    static final IFn Meta = var("clojure.core", "meta");
    static final IFn Name = var("clojure.core", "name");
    static final IFn Nth = var("clojure.core", "nth");
    static final IFn Persistent = var("clojure.core", "persistent!");
    static final IFn PrOn = var("clojure.core", "pr-on");
    static final IFn Read = var("clojure.edn", "read");
    static final IFn ReadString = var("clojure.edn", "read-string");
    static final IFn RemoveMethod = var("clojure.core", "remove-method");
    static final IFn Transient = var("clojure.core", "transient");
    static final IFn WithMeta = var("clojure.core", "with-meta");
    static final IFn VaryMeta = var("clojure.core", "vary-meta");

    static final Object PrintMethod = Deref.invoke(var("clojure.core", "print-method"));
    static final IFn CachedRead = (IFn) Memoize.invoke(var("clojure.edn", "read-string"));
    static final IFn Pprint;
    static final IFn Diff;

    static {
        IFn require = var("clojure.core", "require");
        require.invoke(read("clojure.pprint"));
        require.invoke(read("clojure.data"));

        Pprint = var("clojure.pprint/pprint");
        Diff = var("clojure.data/diff");
    }

    static Object cachedRead(String edn) {
        return CachedRead.invoke(edn);
    }
}

@@ -512,28 +512,25 @@
 clojure.core
-%22, %22
+/
 assoc%22);%0A   
@@ -576,20 +576,17 @@
 ure.core
-%22, %22
+/
 assoc!%22)
@@ -630,28 +630,25 @@
 clojure.core
-%22, %22
+/
 bigint%22);%0A  
@@ -696,20 +696,17 @@
 ure.core
-%22, %22
+/
 biginteg
@@ -760,20 +760,17 @@
 ure.core
-%22, %22
+/
 conj!%22);
@@ -816,20 +816,17 @@
 ure.core
-%22, %22
+/
 deref%22);
@@ -873,20 +873,17 @@
 ure.core
-%22, %22
+/
 dissoc%22)
@@ -929,20 +929,17 @@
 ure.core
-%22, %22
+/
 eval%22);%0A
@@ -982,20 +982,17 @@
 ure.core
-%22, %22
+/
 get%22);%0A 
@@ -1038,20 +1038,17 @@
 ure.core
-%22, %22
+/
 memoize%22
@@ -1100,20 +1100,17 @@
 ure.core
-%22, %22
+/
 merge-wi
@@ -1160,20 +1160,17 @@
 ure.core
-%22, %22
+/
 meta%22);%0A
@@ -1214,20 +1214,17 @@
 ure.core
-%22, %22
+/
 name%22);%0A
@@ -1267,20 +1267,17 @@
 ure.core
-%22, %22
+/
 nth%22);%0A 
@@ -1326,20 +1326,17 @@
 ure.core
-%22, %22
+/
 persiste
@@ -1387,20 +1387,17 @@
 ure.core
-%22, %22
+/
 pr-on%22);
@@ -1437,28 +1437,25 @@
 %22clojure.edn
-%22, %22
+/
 read%22);%0A    
@@ -1492,36 +1492,33 @@
 var(%22clojure.edn
-%22, %22
+/
 read-string%22);%0A 
@@ -1569,20 +1569,17 @@
 ure.core
-%22, %22
+/
 remove-m
@@ -1637,20 +1637,17 @@
 ure.core
-%22, %22
+/
 transien
@@ -1700,20 +1700,17 @@
 ure.core
-%22, %22
+/
 with-met
@@ -1763,20 +1763,17 @@
 ure.core
-%22, %22
+/
 vary-met
@@ -1846,20 +1846,17 @@
 ure.core
-%22, %22
+/
 print-me
@@ -1935,20 +1935,17 @@
 jure.edn
-%22, %22
+/
 read-str
@@ -2065,12 +2065,9 @@
 core
-%22, %22
+/
 requ

Use qualified names