Package tech.v3

Class Clj


  • public class Clj
    extends java.lang.Object
    Static methods to make using Clojure much easier via Java. The least verbose way of using this class is to use it as a static import. One thing to note is that we provide a convenience interface, tech.v3.datatype.IFnDef that provides default implementations for all of the many IFn invoke arities so you can very easily create an implementation of clojure.lang.IFn like so:
     return new tech.v3.datatype.IFnDef() {
       public Object invoke(Object lhs, Object rhs) {
         return doYourThing(lhs,rhs);
       }
     };
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static clojure.lang.IFn applyFn
      clojure.core/apply in var form.
      static clojure.lang.IFn assocFn
      dissoc fn.
      static java.util.Comparator compare  
      static clojure.lang.IFn dissocFn
      dissoc fn.
      static clojure.lang.Var errVar  
      static clojure.lang.IFn greaterThanFn  
      static clojure.lang.IFn identityFn  
      static clojure.lang.IFn lessThanFn  
      static clojure.lang.IFn mergeFn
      merge fn.
      static clojure.lang.Var outVar  
      static clojure.lang.IFn updateFn
      update fn.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object apply​(java.lang.Object obj, java.lang.Object... args)
      Invoke an implementation of clojure.lang.IFn with variable arguments.
      static java.lang.Object assoc​(java.lang.Object mapOrNil, java.lang.Object key, java.lang.Object val)
      Assoc a new key,val into the map.
      static java.lang.Object assoc​(java.lang.Object mapOrNil, java.lang.Object key, java.lang.Object val, java.lang.Object... args)
      Assoc new key,vals into the map.
      static java.lang.Object atom​(java.lang.Object val)
      Create a Clojure atom.
      static java.lang.Object call​(java.lang.Object obj)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10, java.lang.Object arg11)
      Invoke an implementation of clojure.lang.IFn.
      static java.lang.Object call​(java.lang.Object obj, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10, java.lang.Object arg11, java.lang.Object arg12)
      Invoke an implementation of clojure.lang.IFn.
      static boolean compareAndSet​(java.lang.Object atom, java.lang.Object oldval, java.lang.Object newval)
      Conditionally set the value of the atom to newval if the current contents match exactly oldval returning true on success.
      static void compile​(java.lang.String namespace)
      Compile a clojure namespace into class files.
      static void compile​(java.lang.String namespace, java.lang.String outputDir)
      Compile a clojure namespace into class files located in a specific output directory.
      static clojure.lang.IDeref delay​(clojure.lang.IFn code)
      Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls.
      static java.lang.Object deref​(java.lang.Object data)
      Deref a Clojure deref'able object.
      static java.lang.Object dissoc​(java.lang.Object mapOrNil, java.lang.Object key)
      Dissoc a key from a map returning a new map.
      static java.lang.Object dissoc​(java.lang.Object mapOrNil, java.lang.Object key, java.lang.Object... keys)
      Dissoc keys from a map returning a new map.
      static clojure.lang.ISeq filter​(clojure.lang.IFn pred, java.lang.Object data)
      filter a sequence by a predicate.
      static java.util.Map hashmap​(java.lang.Object... args)
      Create a Clojure persistent map with the clojure.core.hash-map function.
      static boolean isVector​(java.lang.Object data)
      Return true if this data is a persistent vector.
      static java.lang.Iterable keys​(java.lang.Object val)
      Return the keys of a map.
      static clojure.lang.Keyword keyword​(java.lang.String name)
      Create a Clojure keyword from a string.
      static clojure.lang.Keyword keyword​(java.lang.String ns, java.lang.String name)
      Create a Clojure namespaced keyword from a namespace name and a string.
      static clojure.lang.Keyword kw​(java.lang.String name)
      Create a Clojure keyword from a string.
      static clojure.lang.Keyword kw​(java.lang.String ns, java.lang.String name)
      Create a Clojure keyword from a namespace name and a string.
      static java.lang.Object list​(java.lang.Object... args)
      Create a Clojure persistent list.
      static java.lang.AutoCloseable makeThreadBindings​(java.util.Map varvalmap)
      !!USE WITH CARE!! - pushThreadBindings and then return an auto-closeable thread bindings object that will pop the thread bindings on close.
      static clojure.lang.ISeq map​(clojure.lang.IFn userFn, java.lang.Object arg0)
      Map a function across one or more sequences.
      static clojure.lang.ISeq map​(clojure.lang.IFn userFn, java.lang.Object arg0, java.lang.Object arg1)
      Map a function across one or more sequences.
      static clojure.lang.ISeq map​(clojure.lang.IFn userFn, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
      Map a function across one or more sequences.
      static clojure.lang.ISeq map​(clojure.lang.IFn userFn, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object... args)
      Map a function across one or more sequences.
      static java.lang.Object merge​(java.lang.Object leftMap, java.lang.Object rightMap)
      Merge a left hashmap with a right hashmap, the rightmost hashmap wins on key conflict.
      static java.lang.Object merge​(java.lang.Object leftMap, java.lang.Object rightMap, java.lang.Object... maps)
      Merge a left hashmap with more hashmaps, the rightmost hashmap wins on key conflict.
      static java.util.Map meta​(java.lang.Object val)
      Return the metadata stored on an object.
      static void popThreadBindings()
      !!USE WITH CARE!! - pop thread bindings that were previously pushed.
      static void println​(java.lang.Object... args)
      Alternative to System.out.println that automatically combines separate strings with spaces and invokes Clojure's more sophisticated print system.
      static void pushThreadBindings​(java.util.Map varvalmap)
      !!USE WITH CARE!!! - push new thread bindings.
      static java.lang.Object range​(java.lang.Object end)
      Create a Clojure range from a single numeric endpoint.
      static java.lang.Object range​(java.lang.Object start, java.lang.Object end)
      Create a Clojure range from a start and end.
      static java.lang.Object range​(java.lang.Object start, java.lang.Object end, java.lang.Object increment)
      Create a Clojure range from a start, end, and increment.
      static boolean realized​(java.lang.Object item)
      Return true if the promise, delay, future, or lazy sequence has been realized.
      static clojure.lang.ISeq repeatedly​(long nTimes, clojure.lang.IFn gen)  
      static clojure.lang.ISeq repeatedly​(clojure.lang.IFn gen)  
      static java.lang.Object require​(java.lang.String ns)
      Ask the clojure runtime to require a particular namespace.
      static clojure.lang.IFn requiringResolve​(java.lang.String ns, java.lang.String name)
      Perform a require and then lookup a var.
      static java.lang.Object reset​(java.lang.Object atom, java.lang.Object val)
      Reset a Clojure atom to a particular value indepedent of its previous contents.
      static void shutdownAgents()
      Clojure has a pool of threads it uses that take a minute to timeout when the program shuts down.
      static java.lang.String str​(java.lang.Object... args)
      Create a larger string by directly concatenating toString representations of arguments.
      static java.lang.Object swap​(java.lang.Object atom, clojure.lang.IFn userSwapFn)
      Swap a Clojure atom using a function that receives its previous value and must return a new value.
      static java.lang.Object swap​(java.lang.Object atom, clojure.lang.IFn userSwapFn, java.lang.Object... args)
      Swap a Clojure atom using a function that receives its previous value followed by args and and must return a new value.
      static clojure.lang.Symbol symbol​(java.lang.String name)
      Create a Clojure symbol object from a string.
      static clojure.lang.Symbol symbol​(java.lang.String ns, java.lang.String name)
      Create a Clojure symbol object from a namespace name and a string.
      static clojure.lang.IFn uncheckedRequiringResolve​(java.lang.String ns, java.lang.String name)
      Perform a require and then lookup a var.
      static java.lang.Object update​(java.lang.Object mapOrNil, java.lang.Object key, clojure.lang.IFn updateFn)
      Update a value at a specific key by passing in a function that gets the previous value and must return a new one.
      static java.lang.Iterable vals​(java.lang.Object val)
      Return the values of a map.
      static clojure.lang.IFn var​(java.lang.String ns, java.lang.String name)
      Find a Clojure public var from a previously required namespace.
      static java.lang.Object varyMeta​(java.lang.Object val, clojure.lang.IFn modifyFn)
      Change the metadata by passing in a function that receives the old value and must return either null or a new PersistentMap value.
      static java.lang.Object varyMeta​(java.lang.Object val, clojure.lang.IFn modifyFn, java.lang.Object... args)
      Change the metadata by passing in a function that recieves the old value as the first argument and then any additional args.
      static java.util.List vec​(java.lang.Object arglist)
      Create a Clojure persistent vector with the clojure.core.vec function - this version takes a single argument that can be an iterable or an array or a derivative of java.util.List.
      static java.util.List vector​(java.lang.Object... args)
      Create a Clojure persistent vector with the clojure.core.vector function.
      static java.lang.Object withMeta​(java.lang.Object val, java.lang.Object data)
      Store different metadata on an Object.
      static java.lang.String withOutStr​(clojure.lang.IFn code)
      Run side-effecting code and return eveything printed to *out* as a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • applyFn

        public static final clojure.lang.IFn applyFn
        clojure.core/apply in var form. Useful as you can call it using call
      • identityFn

        public static final clojure.lang.IFn identityFn
      • lessThanFn

        public static final clojure.lang.IFn lessThanFn
      • greaterThanFn

        public static final clojure.lang.IFn greaterThanFn
      • compare

        public static final java.util.Comparator compare
      • outVar

        public static clojure.lang.Var outVar
      • errVar

        public static clojure.lang.Var errVar
      • mergeFn

        public static final clojure.lang.IFn mergeFn
        merge fn. Useful to pass into update or varyMeta.
      • assocFn

        public static final clojure.lang.IFn assocFn
        dissoc fn. Useful to pass into update or varyMeta.
      • dissocFn

        public static final clojure.lang.IFn dissocFn
        dissoc fn. Useful to pass into update or varyMeta.
      • updateFn

        public static final clojure.lang.IFn updateFn
        update fn. Useful to pass into varyMeta.
    • Method Detail

      • symbol

        public static clojure.lang.Symbol symbol​(java.lang.String name)
        Create a Clojure symbol object from a string.
      • symbol

        public static clojure.lang.Symbol symbol​(java.lang.String ns,
                                                 java.lang.String name)
        Create a Clojure symbol object from a namespace name and a string.
      • keyword

        public static clojure.lang.Keyword keyword​(java.lang.String name)
        Create a Clojure keyword from a string. Keywords are used extremely frequently in Clojure so there is a shorthand method - kw.
      • kw

        public static clojure.lang.Keyword kw​(java.lang.String name)
        Create a Clojure keyword from a string.
      • keyword

        public static clojure.lang.Keyword keyword​(java.lang.String ns,
                                                   java.lang.String name)
        Create a Clojure namespaced keyword from a namespace name and a string.
      • kw

        public static clojure.lang.Keyword kw​(java.lang.String ns,
                                              java.lang.String name)
        Create a Clojure keyword from a namespace name and a string.
      • require

        public static java.lang.Object require​(java.lang.String ns)
        Ask the clojure runtime to require a particular namespace. This must be used before a 'var' lookup but is not required to be used before a 'requiringResolve' lookup.
      • var

        public static clojure.lang.IFn var​(java.lang.String ns,
                                           java.lang.String name)
        Find a Clojure public var from a previously required namespace. This method returns null on if the var cannot be found.
      • uncheckedRequiringResolve

        public static clojure.lang.IFn uncheckedRequiringResolve​(java.lang.String ns,
                                                                 java.lang.String name)
        Perform a require and then lookup a var. Returns 'null' on failure.
      • requiringResolve

        public static clojure.lang.IFn requiringResolve​(java.lang.String ns,
                                                        java.lang.String name)
        Perform a require and then lookup a var. Throws exception if the var isn't found. If an exception isn't desired, use 'uncheckedRequiringResolve'.
      • call

        public static java.lang.Object call​(java.lang.Object obj)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6,
                                            java.lang.Object arg7)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6,
                                            java.lang.Object arg7,
                                            java.lang.Object arg8)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6,
                                            java.lang.Object arg7,
                                            java.lang.Object arg8,
                                            java.lang.Object arg9)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6,
                                            java.lang.Object arg7,
                                            java.lang.Object arg8,
                                            java.lang.Object arg9,
                                            java.lang.Object arg10)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6,
                                            java.lang.Object arg7,
                                            java.lang.Object arg8,
                                            java.lang.Object arg9,
                                            java.lang.Object arg10,
                                            java.lang.Object arg11)
        Invoke an implementation of clojure.lang.IFn.
      • call

        public static java.lang.Object call​(java.lang.Object obj,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5,
                                            java.lang.Object arg6,
                                            java.lang.Object arg7,
                                            java.lang.Object arg8,
                                            java.lang.Object arg9,
                                            java.lang.Object arg10,
                                            java.lang.Object arg11,
                                            java.lang.Object arg12)
        Invoke an implementation of clojure.lang.IFn.
      • apply

        public static java.lang.Object apply​(java.lang.Object obj,
                                             java.lang.Object... args)

        Invoke an implementation of clojure.lang.IFn with variable arguments. Also this class exposes applyFn to allow you to do things like:

        return call(applyFn, afn, arg1, arg2, restargs);
      • println

        public static void println​(java.lang.Object... args)
        Alternative to System.out.println that automatically combines separate strings with spaces and invokes Clojure's more sophisticated print system.
      • str

        public static java.lang.String str​(java.lang.Object... args)
        Create a larger string by directly concatenating toString representations of arguments.
      • withOutStr

        public static java.lang.String withOutStr​(clojure.lang.IFn code)
        Run side-effecting code and return eveything printed to *out* as a string.
      • hashmap

        public static java.util.Map hashmap​(java.lang.Object... args)
        Create a Clojure persistent map with the clojure.core.hash-map function.
      • vector

        public static java.util.List vector​(java.lang.Object... args)
        Create a Clojure persistent vector with the clojure.core.vector function.
      • vec

        public static java.util.List vec​(java.lang.Object arglist)
        Create a Clojure persistent vector with the clojure.core.vec function - this version takes a single argument that can be an iterable or an array or a derivative of java.util.List.
      • isVector

        public static boolean isVector​(java.lang.Object data)
        Return true if this data is a persistent vector.
      • merge

        public static java.lang.Object merge​(java.lang.Object leftMap,
                                             java.lang.Object rightMap)
        Merge a left hashmap with a right hashmap, the rightmost hashmap wins on key conflict.
      • merge

        public static java.lang.Object merge​(java.lang.Object leftMap,
                                             java.lang.Object rightMap,
                                             java.lang.Object... maps)
        Merge a left hashmap with more hashmaps, the rightmost hashmap wins on key conflict.
      • assoc

        public static java.lang.Object assoc​(java.lang.Object mapOrNil,
                                             java.lang.Object key,
                                             java.lang.Object val)
        Assoc a new key,val into the map. Returns a new map.
      • assoc

        public static java.lang.Object assoc​(java.lang.Object mapOrNil,
                                             java.lang.Object key,
                                             java.lang.Object val,
                                             java.lang.Object... args)
        Assoc new key,vals into the map. Returns a new map.
      • dissoc

        public static java.lang.Object dissoc​(java.lang.Object mapOrNil,
                                              java.lang.Object key)
        Dissoc a key from a map returning a new map.
      • dissoc

        public static java.lang.Object dissoc​(java.lang.Object mapOrNil,
                                              java.lang.Object key,
                                              java.lang.Object... keys)
        Dissoc keys from a map returning a new map.
      • update

        public static java.lang.Object update​(java.lang.Object mapOrNil,
                                              java.lang.Object key,
                                              clojure.lang.IFn updateFn)
        Update a value at a specific key by passing in a function that gets the previous value and must return a new one. Key does not need to previously exist. Returns a new map.
      • range

        public static java.lang.Object range​(java.lang.Object end)
        Create a Clojure range from a single numeric endpoint.
      • range

        public static java.lang.Object range​(java.lang.Object start,
                                             java.lang.Object end)
        Create a Clojure range from a start and end. Range will be [start, end).
      • range

        public static java.lang.Object range​(java.lang.Object start,
                                             java.lang.Object end,
                                             java.lang.Object increment)
        Create a Clojure range from a start, end, and increment. Range will be [start, end).
      • list

        public static java.lang.Object list​(java.lang.Object... args)
        Create a Clojure persistent list.
      • pushThreadBindings

        public static void pushThreadBindings​(java.util.Map varvalmap)
        !!USE WITH CARE!!! - push new thread bindings. This is best left ignored unless you need it to interact with Clojure libraries. popThreadBindings *must* be called within the same thread e.g. in a finally clause. varvalmap is a map of Clojure Var (the result of 'var' or 'requiringResolve') to values. The Vars in the map must be dynamic vars else the per-thread bindings will not work.
      • popThreadBindings

        public static void popThreadBindings()
        !!USE WITH CARE!! - pop thread bindings that were previously pushed.
      • makeThreadBindings

        public static java.lang.AutoCloseable makeThreadBindings​(java.util.Map varvalmap)
        !!USE WITH CARE!! - pushThreadBindings and then return an auto-closeable thread bindings object that will pop the thread bindings on close. Meant to be used within a try-with-resources pattern.
      • deref

        public static java.lang.Object deref​(java.lang.Object data)
        Deref a Clojure deref'able object. These include at least vars, atoms, futures, many custom object types. These types all derive from clojure.lang.IDeref at the very least.
      • atom

        public static java.lang.Object atom​(java.lang.Object val)
        Create a Clojure atom. Atoms allow simple, efficient, and safe multi-threaded use cases. To get the value of the atom call 'deref'.
      • reset

        public static java.lang.Object reset​(java.lang.Object atom,
                                             java.lang.Object val)
        Reset a Clojure atom to a particular value indepedent of its previous contents.
      • swap

        public static java.lang.Object swap​(java.lang.Object atom,
                                            clojure.lang.IFn userSwapFn)
        Swap a Clojure atom using a function that receives its previous value and must return a new value. See namespace comments for easy ways to create an implementation of clojure.lang.IFn.
      • swap

        public static java.lang.Object swap​(java.lang.Object atom,
                                            clojure.lang.IFn userSwapFn,
                                            java.lang.Object... args)
        Swap a Clojure atom using a function that receives its previous value followed by args and and must return a new value. See namespace comments for easy ways to create an implementation of clojure.lang.IFn.
      • compareAndSet

        public static boolean compareAndSet​(java.lang.Object atom,
                                            java.lang.Object oldval,
                                            java.lang.Object newval)
        Conditionally set the value of the atom to newval if the current contents match exactly oldval returning true on success.
      • meta

        public static java.util.Map meta​(java.lang.Object val)
        Return the metadata stored on an object. Most Clojure objects implement IMeta and this is a wrapper around calling its meta member fn.
      • withMeta

        public static java.lang.Object withMeta​(java.lang.Object val,
                                                java.lang.Object data)
        Store different metadata on an Object. Most Clojure objects implement IObj and this is a wrapper around calling its withMeta member fn.
      • varyMeta

        public static java.lang.Object varyMeta​(java.lang.Object val,
                                                clojure.lang.IFn modifyFn)
        Change the metadata by passing in a function that receives the old value and must return either null or a new PersistentMap value.
      • varyMeta

        public static java.lang.Object varyMeta​(java.lang.Object val,
                                                clojure.lang.IFn modifyFn,
                                                java.lang.Object... args)
        Change the metadata by passing in a function that recieves the old value as the first argument and then any additional args. Function must return either null or a new PersistentMap.
      • keys

        public static java.lang.Iterable keys​(java.lang.Object val)
        Return the keys of a map.
      • vals

        public static java.lang.Iterable vals​(java.lang.Object val)
        Return the values of a map.
      • delay

        public static clojure.lang.IDeref delay​(clojure.lang.IFn code)
        Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls.
      • realized

        public static boolean realized​(java.lang.Object item)
        Return true if the promise, delay, future, or lazy sequence has been realized.
      • compile

        public static void compile​(java.lang.String namespace)

        Compile a clojure namespace into class files. Compilation path defaults to './classes'. If this compilation pathway is on the classpath then that namespace will load potentially much faster next time it is 'require'd.

        './classes' must exist.

        The major caveat here is if you upgrade the base clojure library you must recompile. A difference between the version of the .clj files and the version of the .class files will lead to unpredictable errors running the code.

      • compile

        public static void compile​(java.lang.String namespace,
                                   java.lang.String outputDir)

        Compile a clojure namespace into class files located in a specific output directory. If this output directoryis on the classpath then that namespace will load potentially much faster next time it is 'require'd.

        outputDir must exist.

        The major caveat here is if you upgrade the base clojure library you must recompile. A difference between the version of the .clj files and the version of the .class files will lead to unpredictable errors running the code.

      • map

        public static clojure.lang.ISeq map​(clojure.lang.IFn userFn,
                                            java.lang.Object arg0,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object... args)
        Map a function across one or more sequences. Resulting sequence will be the length of the shortest input sequences.
      • map

        public static clojure.lang.ISeq map​(clojure.lang.IFn userFn,
                                            java.lang.Object arg0,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2)
        Map a function across one or more sequences. Resulting sequence will be the length of the shortest input sequences.
      • map

        public static clojure.lang.ISeq map​(clojure.lang.IFn userFn,
                                            java.lang.Object arg0,
                                            java.lang.Object arg1)
        Map a function across one or more sequences. Resulting sequence will be the length of the shortest input sequences.
      • map

        public static clojure.lang.ISeq map​(clojure.lang.IFn userFn,
                                            java.lang.Object arg0)
        Map a function across one or more sequences. Resulting sequence will be the length of the shortest input sequences.
      • filter

        public static clojure.lang.ISeq filter​(clojure.lang.IFn pred,
                                               java.lang.Object data)
        filter a sequence by a predicate.
      • repeatedly

        public static clojure.lang.ISeq repeatedly​(long nTimes,
                                                   clojure.lang.IFn gen)
      • repeatedly

        public static clojure.lang.ISeq repeatedly​(clojure.lang.IFn gen)
      • shutdownAgents

        public static void shutdownAgents()
        Clojure has a pool of threads it uses that take a minute to timeout when the program shuts down. In order to make the shutdown quicker, you can always safely call shutdownAgents just before your program exits.