Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

tupelo.core

Tupelo - Making Clojure even sweeter

Tupelo - Making Clojure even sweeter
raw docstring

*cumulative-val*clj/s

A dynamic Var pointing to an atom. Used by with-cum-val to accumulate state, such as in a vector or map. Typically manipulated via helper functions such as cum-val-set-it or cum-vector-append. Can also be manipulated directly via swap! et al.

A dynamic Var pointing to an `atom`. Used by `with-cum-val` to accumulate state,
such as in a vector or map.  Typically manipulated via helper functions such as
`cum-val-set-it` or `cum-vector-append`. Can also be manipulated directly via `swap!` et al.
sourceraw docstring

*lazy-gen-buffer-size*clj

Default output buffer size for lazy-gen.

Default output buffer size for `lazy-gen`.
sourceraw docstring

*spy-enabled*clj/s

source

*spy-enabled-map*clj/s

source

->falseclj/s

(->false & args)

A function that accepts any number of args, does nothing, and returns false.

A function that accepts any number of args, does nothing, and returns `false`.
sourceraw docstring

->kwclj/s

(->kw arg)

Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol s/Num)] Returns: s/Keyword

Coerce arg to a keyword

Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol s/Num)]
Returns: s/Keyword

Coerce arg to a keyword
sourceraw docstring

->listclj/s

(->list arg)

Inputs: [arg :- [s/Any]] Returns: [s/Any]

Coerce any sequential argument into a List.

Inputs: [arg :- [s/Any]]
Returns: [s/Any]

Coerce any sequential argument into a List.
sourceraw docstring

->map-entryclj/s

(->map-entry arg)

Inputs: [arg] Returns: tsk/MapEntry

Coerce arg into a clojure.lang.MapEntry

Inputs: [arg]
Returns: tsk/MapEntry

Coerce arg into a clojure.lang.MapEntry
sourceraw docstring

->nilclj/s

(->nil & args)

A function that accepts any number of args, does nothing, and returns nil.

A function that accepts any number of args, does nothing, and returns `nil`.
sourceraw docstring

->oneclj/s

(->one & args)

A function that accepts any number of args, does nothing, and returns the number one.

A function that accepts any number of args, does nothing, and returns the number one.
sourceraw docstring

->setclj/s

(->set arg)

Inputs: [arg] Returns: tsk/Set

Converts arg to a set.

Inputs: [arg]
Returns: tsk/Set

Converts arg to a set.
sourceraw docstring

->sorted-mapclj/s

(->sorted-map map-in)

Inputs: [map-in :- tsk/Map] Returns: tsk/Map

Coerces a map into a sorted-map

Inputs: [map-in :- tsk/Map]
Returns: tsk/Map

Coerces a map into a sorted-map
sourceraw docstring

->sorted-map-genericclj/s

(->sorted-map-generic map-in)

Inputs: [map-in :- tsk/Map] Returns: tsk/Map

Coerces a map into a sorted-map

Inputs: [map-in :- tsk/Map]
Returns: tsk/Map

Coerces a map into a sorted-map
sourceraw docstring

->sorted-setclj/s

(->sorted-set set-in)

Inputs: [set-in :- tsk/Set] Returns: tsk/Set

Coerces a set into a sorted-set

Inputs: [set-in :- tsk/Set]
Returns: tsk/Set

Coerces a set into a sorted-set
sourceraw docstring

->sorted-set-genericclj/s

(->sorted-set-generic set-in)

Inputs: [set-in :- tsk/Set] Returns: tsk/Set

Coerces a set into a sorted-set-generic

Inputs: [set-in :- tsk/Set]
Returns: tsk/Set

Coerces a set into a sorted-set-generic
sourceraw docstring

->strclj/s

(->str arg)

Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol s/Num)] Returns: s/Str

Coerce arg to a string

Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol s/Num)]
Returns: s/Str

Coerce arg to a string
sourceraw docstring

->symclj/s

(->sym arg)

Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Symbol

Coerce arg to a symbol

Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)]
Returns: s/Symbol

Coerce arg to a symbol
sourceraw docstring

->trueclj/s

(->true & args)

A function that accepts any number of args, does nothing, and returns true.

A function that accepts any number of args, does nothing, and returns `true`.
sourceraw docstring

->vectorclj/s≠

clj
(->vector & args)
cljs
(->vector & rest113033)

Inputs: [& args :- [s/Any]] Returns: [s/Any]

Wraps all args in a vector, as with clojure.core/vector. Will (recursively) recognize any embedded calls to (unwrap <vec-or-list>) and insert their elements as with the unquote-spicing operator (~@). Examples:

  (->vector 1 2 3 4 5 6 7 8 9)              =>  [1 2 3 4 5 6 7 8 9]
  (->vector 1 2 3 (unwrap [4 5 6]) 7 8 9)   =>  [1 2 3 4 5 6 7 8 9] 
Inputs: [& args :- [s/Any]]
Returns: [s/Any]

Wraps all args in a vector, as with `clojure.core/vector`. Will (recursively) recognize
any embedded calls to (unwrap <vec-or-list>) and insert their elements as with the
unquote-spicing operator (~@). Examples:

      (->vector 1 2 3 4 5 6 7 8 9)              =>  [1 2 3 4 5 6 7 8 9]
      (->vector 1 2 3 (unwrap [4 5 6]) 7 8 9)   =>  [1 2 3 4 5 6 7 8 9] 
sourceraw docstring

->zeroclj/s

(->zero & args)

A function that accepts any number of args, does nothing, and returns the number zero.

A function that accepts any number of args, does nothing, and returns the number zero.
sourceraw docstring

all-rel=clj/s

(all-rel= x-vals y-vals & opts)

Applies

Applies
sourceraw docstring

appendclj/s≠

clj
(append listy & elems)
cljs
(append G__112683 & rest112684)

Inputs: [listy :- tsk/List & elems :- [s/Any]] Returns: tsk/List

Given a sequential object (vector or list), add one or more elements to the end.

Inputs: [listy :- tsk/List & elems :- [s/Any]]
Returns: tsk/List

Given a sequential object (vector or list), add one or more elements to the end.
sourceraw docstring

bigdecimal?clj

(bigdecimal? x)

Returns true if x is a java.math.BigDecimal (synonym for clojure.core/decimal?)

Returns true if x is a java.math.BigDecimal (synonym for `clojure.core/decimal?`)
sourceraw docstring

bigint?clj

(bigint? x)

Returns true if x is a clojure.lang.BigInt

Returns true if x is a clojure.lang.BigInt
sourceraw docstring

biginteger?clj

(biginteger? x)

Returns true if x is a java.math.BigInteger

Returns true if x is a java.math.BigInteger
sourceraw docstring

chan->lazy-seqclj

(chan->lazy-seq chan)

Accepts a core.async channel and returns the contents as a lazy list.

Accepts a core.async channel and returns the contents as a lazy list.
sourceraw docstring

char->codepointclj/s

(char->codepoint arg)

Inputs: [arg :- s/Any] Returns: s/Int

Convert a char to an unicode int

Inputs: [arg :- s/Any]
Returns: s/Int

Convert a char to an unicode int
sourceraw docstring

char->symclj/s

(char->sym ch)
source

chars-thruclj/s

(chars-thru start-char stop-char)

Given two characters (or numerical equivalents), returns a seq of characters (inclusive) from the first to the second. Characters must be in ascending order.

Given two characters (or numerical equivalents), returns a seq of characters
(inclusive) from the first to the second.  Characters must be in ascending order.
sourceraw docstring

check-spy-enabledclj/smacro

(check-spy-enabled tag & forms)
source

clip-strclj/s

(clip-str nchars & args)

Converts all args to single string and clips any characters beyond nchars.

Converts all args to single string and clips any characters beyond nchars.
sourceraw docstring

codepoint->charclj/s

(codepoint->char arg)

Inputs: [arg :- s/Int] Returns: s/Any

Convert a unicode int to a char

Inputs: [arg :- s/Int]
Returns: s/Any

Convert a unicode int to a char
sourceraw docstring

cond-it->clj/smacro

(cond-it-> & forms)

A threading macro like cond-> that always uses the symbol 'it' as the placeholder for the next threaded value. Works in both the conditional form and the value form:

(let [params {:a 1 :b 1 :c nil :d nil}]
  (cond-it-> params
    (:a it)        (update it :b inc)
    (= (:b it) 2)  (assoc it :c "here")
    (:c it)        (assoc it :d "again")))

;=> {:a 1, :b 2, :c "here", :d "again"}
A threading macro like cond-> that always uses the symbol 'it' as the placeholder for the next threaded value.
Works in both the conditional form and the value form:

    (let [params {:a 1 :b 1 :c nil :d nil}]
      (cond-it-> params
        (:a it)        (update it :b inc)
        (= (:b it) 2)  (assoc it :c "here")
        (:c it)        (assoc it :d "again")))

    ;=> {:a 1, :b 2, :c "here", :d "again"}
sourceraw docstring

const-fnclj/s

(const-fn val)

Returns a function that always returns the specified value, and accepts any number of args (synonym for clojure.core/constantly).

Returns a function that always returns the specified value, and accepts any number of args
(synonym for `clojure.core/constantly`).
sourceraw docstring

constructclj/smacro

(construct template)
source

construct-implclj/s

(construct-impl template)
source

contains-elem?clj/s

(contains-elem? coll elem)

Inputs: [coll :- s/Any elem :- s/Any] Returns: s/Bool

For any collection coll & element tgt, returns true if coll contains at least one instance of tgt; otherwise returns false. Note that, for maps, each element is a vector (i.e MapEntry) of the form [key value].

Inputs: [coll :- s/Any elem :- s/Any]
Returns: s/Bool

For any collection coll & element tgt, returns true if coll contains at least one
instance of tgt; otherwise returns false. Note that, for maps, each element is a
vector (i.e MapEntry) of the form [key value].
sourceraw docstring

contains-key?clj/s≠

(contains-key? map-or-set elem)
clj

Inputs: [map-or-set :- (s/pred (fn* [p1__15610#] (or (map? p1__15610#) (set? p1__15610#)))) elem :- s/Any] Returns: s/Bool

For any map or set, returns true if elem is a map key or set element, respectively

Inputs: [map-or-set :- (s/pred (fn* [p1__15610#] (or (map? p1__15610#) (set? p1__15610#)))) elem :- s/Any]
Returns: s/Bool

For any map or set, returns true if elem is a map key or set element, respectively
cljs

Inputs: [map-or-set :- (s/pred (fn* [p1__112596#] (or (map? p1__112596#) (set? p1__112596#)))) elem :- s/Any] Returns: s/Bool

For any map or set, returns true if elem is a map key or set element, respectively

Inputs: [map-or-set :- (s/pred (fn* [p1__112596#] (or (map? p1__112596#) (set? p1__112596#)))) elem :- s/Any]
Returns: s/Bool

For any map or set, returns true if elem is a map key or set element, respectively
sourceraw docstring

contains-val?clj/s

(contains-val? map elem)

Inputs: [map :- tsk/Map elem :- s/Any] Returns: s/Bool

For any map, returns true if elem is present in the map for at least one key.

Inputs: [map :- tsk/Map elem :- s/Any]
Returns: s/Bool

For any map, returns true if elem is present in the map for at least one key.
sourceraw docstring

cum-val-set-itclj/smacro

(cum-val-set-it & forms)

Works inside of a with-cum-val block to append a new val value.

Works inside of a `with-cum-val` block to append a new val value.
sourceraw docstring

cum-vector-appendclj/s

(cum-vector-append value)

Inputs: [value :- s/Any] Returns: s/Any

Works inside of a with-cum-vector block to append a new vector value.

Inputs: [value :- s/Any]
Returns: s/Any

Works inside of a `with-cum-vector` block to append a new vector value.
sourceraw docstring

destructclj/smacro

(destruct bindings & forms)

Natural destructuring:

(let [data {:a 1
            :b {:c 3
                :d 4}}]
  ...
  (destruct [data {:a ?
                   :b {:c ?}}]
  ...

then can use local values a=1, c=3. With vector data:

(let [data [1 2 3 4 5]]
  ...
  (destruct [data [a b c]]
   ...

then can use local values a=1 b=2 c=3. Can use (restruct), (restruct data), or (restruct-all) to re-structure & return original data shape using current values.

Natural destructuring:

    (let [data {:a 1
                :b {:c 3
                    :d 4}}]
      ...
      (destruct [data {:a ?
                       :b {:c ?}}]
      ...

then can use local values  a=1, c=3.  With vector data:

    (let [data [1 2 3 4 5]]
      ...
      (destruct [data [a b c]]
       ...

then can use local values a=1 b=2 c=3.  Can use `(restruct)`, `(restruct data)`, or `(restruct-all)`
to re-structure & return original data shape using current values.
sourceraw docstring

discarding-system-errclj/smacro

(discarding-system-err & body)

Evaluates exprs in a context in which JVM System/err is bound to a fresh PrintStream that is discarded.

Evaluates exprs in a context in which JVM System/err is bound to a fresh PrintStream that is discarded.
sourceraw docstring

discarding-system-outclj/smacro

(discarding-system-out & body)

Evaluates exprs in a context in which JVM System/out is bound to a fresh PrintStream that is discarded.

Evaluates exprs in a context in which JVM System/out is bound to a fresh PrintStream that is discarded.
sourceraw docstring

dissoc-inclj/s

(dissoc-in the-map keys-vec)

Inputs: [the-map :- tsk/Map keys-vec :- [s/Any]] Returns: s/Any

A sane version of dissoc-in that will not delete intermediate keys. When invoked as (dissoc-in the-map [:k1 :k2 :k3... :kZ]), acts like (clojure.core/update-in the-map [:k1 :k2 :k3...] dissoc :kZ). That is, only the map entry containing the last key :kZ is removed, and all map entries higher than kZ in the hierarchy are unaffected.

Inputs: [the-map :- tsk/Map keys-vec :- [s/Any]]
Returns: s/Any

A sane version of dissoc-in that will not delete intermediate keys.
 When invoked as (dissoc-in the-map [:k1 :k2 :k3... :kZ]), acts like
 (clojure.core/update-in the-map [:k1 :k2 :k3...] dissoc :kZ). That is, only
 the map entry containing the last key :kZ is removed, and all map entries
 higher than kZ in the hierarchy are unaffected.
sourceraw docstring

distinct-usingclj/s

(distinct-using keyfn coll)

Removes elements from a collection so that the result has no duplicates of (keyfn <elem>). Employs a first-one-wins strategy. Not lazy.

Removes elements from a collection so that the result has no duplicates of `(keyfn <elem>)`.
Employs a first-one-wins strategy. Not lazy.
sourceraw docstring

drop-atclj/s

(drop-at coll index)

Inputs: [coll :- tsk/List index :- s/Int] Returns: tsk/List

Removes an element from a collection at the specified index.

Inputs: [coll :- tsk/List index :- s/Int]
Returns: tsk/List

Removes an element from a collection at the specified index.
sourceraw docstring

drop-ifclj/s

(drop-if pred coll)

Returns a vector of items in coll for which (pred item) is false (alias for clojure.core/remove)

Returns a vector of items in coll for which (pred item) is false (alias for clojure.core/remove)
sourceraw docstring

edn->jsonclj/s≠

(edn->json arg)
clj

Inputs: [arg] Returns: s/Str

Shortcut to cheshire.core/generate-string

Inputs: [arg]
Returns: s/Str

Shortcut to cheshire.core/generate-string
cljs

Inputs: [arg] Returns: s/Str

Convert from edn -> json

Inputs: [arg]
Returns: s/Str

Convert from edn -> json 
source (clj)source (cljs)raw docstring

exception-messageclj

(exception-message exception)

Returns the message from an exception => (.getMessage exception)

Returns the message from an exception => (.getMessage exception)
sourceraw docstring

exception-stacktraceclj

(exception-stacktrace exception)

Returns the stacktrace from an exception

Returns the stacktrace from an exception 
sourceraw docstring

falsey?clj/s

(falsey? arg)

Returns true if arg is logical false (either nil or false); otherwise returns false. Equivalent to (not (truthy? arg)).

Returns true if arg is logical false (either nil or false); otherwise returns false. Equivalent
to (not (truthy? arg)).
sourceraw docstring

fetchclj/s

(fetch the-map the-key)

Inputs: [the-map :- tsk/Map the-key :- s/Any] Returns: s/Any

A fail-fast version of keyword/map lookup. When invoked as (fetch the-map :the-key), returns the value associated with :the-key as for (clojure.core/get the-map :the-key). Throws an Exception if :the-key is not present in the-map.

Inputs: [the-map :- tsk/Map the-key :- s/Any]
Returns: s/Any

A fail-fast version of keyword/map lookup.  When invoked as (fetch the-map :the-key),
 returns the value associated with :the-key as for (clojure.core/get the-map :the-key).
 Throws an Exception if :the-key is not present in the-map.
sourceraw docstring

fetch-inclj/s

(fetch-in mappy path)

Inputs: [mappy :- (s/cond-pre tsk/Map tsk/Vec) path :- tsk/Vec] Returns: s/Any

A fail-fast version of clojure.core/get-in. When invoked as (fetch-in mappy path), returns the value associated with path as for (clojure.core/get-in mappy path). Throws an Exception if the path path is not present in mappy.

Inputs: [mappy :- (s/cond-pre tsk/Map tsk/Vec) path :- tsk/Vec]
Returns: s/Any

A fail-fast version of clojure.core/get-in. When invoked as (fetch-in mappy path),
 returns the value associated with path as for (clojure.core/get-in mappy path).
 Throws an Exception if the path path is not present in mappy.
sourceraw docstring

fibo-nthclj/s

(fibo-nth N)

Returns the N'th Fibonacci number (zero-based). Note that N=91 corresponds to approx 2^62

Returns the N'th Fibonacci number (zero-based). Note that
N=91 corresponds to approx 2^62
sourceraw docstring

fibo-thruclj/s

(fibo-thru limit)

Returns a vector of Fibonacci numbers up to limit (inclusive). Note that a 2^62 corresponds to 91'st Fibonacci number.

Returns a vector of Fibonacci numbers up to limit (inclusive). Note that a
2^62  corresponds to 91'st Fibonacci number.
sourceraw docstring

fibonacci-seqclj/s

(fibonacci-seq)

A lazy seq of Fibonacci numbers (memoized).

A lazy seq of Fibonacci numbers (memoized).
sourceraw docstring

first-or-nilclj/s

(first-or-nil seq-arg)

Returns the first item in a sequence, or nil

Returns the first item in a sequence, or nil
sourceraw docstring

for-indexedclj/smacro

(for-indexed & forms)

Like clojure.core/map-indexed, converts each element x in a sequence into a Pair [i x], where i is the zero-based index number. Supports only a single sequence in the binding form. Wraps all forms with an implicit (do ...) as with clojure.core/doseq. Use tupelo.core/indexed for more complicated looping constructs. Usage:

  (for-indexed [[i x] vals]
    (println (format "i=%d x=%s" i x))
    {:i i :x x} )

is equivalent to:

(vec
  (for [[i x] (indexed vals)]
    (do
      (println (format "i=%d x=%s" i x))
      {:i i :x x} )))  
Like clojure.core/map-indexed, converts each element x in a sequence into a Pair [i x],
where `i` is the zero-based index number. Supports only a single sequence in the binding form.
Wraps all forms with an implicit `(do ...)` as with clojure.core/doseq.  Use `tupelo.core/indexed`
for more complicated looping constructs. Usage:

      (for-indexed [[i x] vals]
        (println (format "i=%d x=%s" i x))
        {:i i :x x} )

is equivalent to:

    (vec
      (for [[i x] (indexed vals)]
        (do
          (println (format "i=%d x=%s" i x))
          {:i i :x x} )))  
sourceraw docstring

for-listclj/smacro

(for-list & forms)

Like clojure.core/for but returns results in an eager list. Wraps the loop body in a do as with doseq. Not lazy.

Like clojure.core/for but returns results in an eager list.
Wraps the loop body in a `do` as with `doseq`. Not lazy.
sourceraw docstring

forvclj/smacro

(forv & forms)

Like clojure.core/for but returns results in a vector. Wraps the loop body in a do as with doseq. Not lazy.

Like clojure.core/for but returns results in a vector.
Wraps the loop body in a `do` as with `doseq`. Not lazy.
sourceraw docstring

fourth-or-nilclj/s

(fourth-or-nil seq-arg)

Returns the fourth item in a sequence, or nil

Returns the fourth item in a sequence, or nil
sourceraw docstring

get-in-strictclj/s

(get-in-strict data path)
source

get-or-defaultclj/s

(get-or-default mappy key default)
source

get-or-nilclj/s

(get-or-nil mappy key)
source

glueclj/s

(glue & colls)

Glues together like collections:

 (glue [1 2] [3 4] [5 6])                -> [1 2 3 4 5 6]
 (glue {:a 1} {:b 2} {:c 3})             -> {:a 1 :c 3 :b 2}
 (glue #{1 2} #{3 4} #{6 5})             -> #{1 2 6 5 3 4}
 (glue "I" " like " \a " nap!" )  -> "I like a nap!"

If you want to convert to a sorted set or map, just put an empty one first:

 (glue (sorted-map) {:a 1} {:b 2} {:c 3})      -> {:a 1 :b 2 :c 3}
 (glue (sorted-set) #{1 2} #{3 4} #{6 5})      -> #{1 2 3 4 5 6}

If there are duplicate keys when using glue for maps or sets, then "the last one wins":

 (glue {:band :VanHalen :singer :Dave}  {:singer :Sammy}) 
Glues together like collections:

     (glue [1 2] [3 4] [5 6])                -> [1 2 3 4 5 6]
     (glue {:a 1} {:b 2} {:c 3})             -> {:a 1 :c 3 :b 2}
     (glue #{1 2} #{3 4} #{6 5})             -> #{1 2 6 5 3 4}
     (glue "I" " like " \a " nap!" )  -> "I like a nap!"

If you want to convert to a sorted set or map, just put an empty one first:

     (glue (sorted-map) {:a 1} {:b 2} {:c 3})      -> {:a 1 :b 2 :c 3}
     (glue (sorted-set) #{1 2} #{3 4} #{6 5})      -> #{1 2 3 4 5 6}

 If there are duplicate keys when using glue for maps or sets, then "the last one wins":

     (glue {:band :VanHalen :singer :Dave}  {:singer :Sammy}) 
sourceraw docstring

glue-rowsclj/s

(glue-rows coll-2d)

Convert a vector of vectors (2-dimensional) into a single vector (1-dimensional). Equivalent to (apply glue ...)

 Convert a vector of vectors (2-dimensional) into a single vector (1-dimensional).
Equivalent to `(apply glue ...)`
sourceraw docstring

grabclj/s

(grab the-key the-map)

Inputs: [the-key :- s/Any the-map :- tsk/Map] Returns: s/Any

A fail-fast version of keyword/map lookup. When invoked as (grab :the-key the-map), returns the value associated with :the-key as for (clojure.core/get the-map :the-key). Throws an Exception if :the-key is not present in the-map.

Inputs: [the-key :- s/Any the-map :- tsk/Map]
Returns: s/Any

A fail-fast version of keyword/map lookup.  When invoked as (grab :the-key the-map),
 returns the value associated with :the-key as for (clojure.core/get the-map :the-key).
 Throws an Exception if :the-key is not present in the-map.
sourceraw docstring

has-length?clj/s

(has-length? coll n)

Returns true if the collection has the indicated length. Does not hang for infinite sequences.

Returns true if the collection has the indicated length. Does not hang for infinite sequences.
sourceraw docstring

has-none?clj/s

(has-none? pred coll)

Inputs: [pred :- s/Any coll :- [s/Any]] Returns: s/Bool

For any predicate pred & collection coll, returns false if (pred x) is logical true for at least one x in coll; otherwise returns true. Equivalent to clojure.core/not-any?, but inverse of has-some?.

Inputs: [pred :- s/Any coll :- [s/Any]]
Returns: s/Bool

For any predicate pred & collection coll, returns false if (pred x) is logical true for at least one x in
 coll; otherwise returns true.  Equivalent to clojure.core/not-any?, but inverse of has-some?.
sourceraw docstring

has-some?clj/s

(has-some? pred coll)

Inputs: [pred :- s/Any coll :- [s/Any]] Returns: s/Bool

For any predicate pred & collection coll, returns true if (pred x) is logical true for at least one x in coll; otherwise returns false. Like clojure.core/some, but returns only true or false.

Inputs: [pred :- s/Any coll :- [s/Any]]
Returns: s/Bool

For any predicate pred & collection coll, returns true if (pred x) is logical true for at least one x in
 coll; otherwise returns false.  Like clojure.core/some, but returns only true or false.
sourceraw docstring

idxclj/s

(idx coll index-val)

Inputs: [coll :- tsk/List index-val :- s/Int]

Indexes into a vector, allowing negative index values

Inputs: [coll :- tsk/List index-val :- s/Int]

Indexes into a vector, allowing negative index values
sourceraw docstring

if-java-1-7-plusclj/smacro

(if-java-1-7-plus if-form else-form)

If JVM is Java 1.7 or higher, evaluates if-form into code. Otherwise, evaluates else-form.

If JVM is Java 1.7 or higher, evaluates if-form into code. Otherwise, evaluates else-form.
sourceraw docstring

if-java-1-8-plusclj/smacro

(if-java-1-8-plus if-form else-form)

If JVM is Java 1.8 or higher, evaluates if-form into code. Otherwise, evaluates else-form.

If JVM is Java 1.8 or higher, evaluates if-form into code. Otherwise, evaluates else-form.
sourceraw docstring

increasing-or-equal?clj/s

(increasing-or-equal? a b)

Inputs: [a :- tsk/List b :- tsk/List] Returns: s/Bool

Returns true iff the vectors are in (strictly) lexicographically increasing-or-equal order

  [1 2]  [1]        -> false
  [1 2]  [1 1]      -> false
  [1 2]  [1 2]      -> true
  [1 2]  [1 2 nil]  -> true
  [1 2]  [1 2 3]    -> true
  [1 2]  [1 3]      -> true
  [1 2]  [2 1]      -> true
  [1 2]  [2]        -> true 
Inputs: [a :- tsk/List b :- tsk/List]
Returns: s/Bool

Returns true iff the vectors are in (strictly) lexicographically increasing-or-equal order

      [1 2]  [1]        -> false
      [1 2]  [1 1]      -> false
      [1 2]  [1 2]      -> true
      [1 2]  [1 2 nil]  -> true
      [1 2]  [1 2 3]    -> true
      [1 2]  [1 3]      -> true
      [1 2]  [2 1]      -> true
      [1 2]  [2]        -> true 
sourceraw docstring

increasing?clj/s

(increasing? a b)

Inputs: [a :- tsk/List b :- tsk/List] Returns: s/Bool

Returns true iff the vectors are in (strictly) lexicographically increasing order

  [1 2]  [1]        -> false
  [1 2]  [1 1]      -> false
  [1 2]  [1 2]      -> false
  [1 2]  [1 2 nil]  -> true
  [1 2]  [1 2 3]    -> true
  [1 2]  [1 3]      -> true
  [1 2]  [2 1]      -> true
  [1 2]  [2]        -> true 
Inputs: [a :- tsk/List b :- tsk/List]
Returns: s/Bool

Returns true iff the vectors are in (strictly) lexicographically increasing order

      [1 2]  [1]        -> false
      [1 2]  [1 1]      -> false
      [1 2]  [1 2]      -> false
      [1 2]  [1 2 nil]  -> true
      [1 2]  [1 2 3]    -> true
      [1 2]  [1 3]      -> true
      [1 2]  [2 1]      -> true
      [1 2]  [2]        -> true 
sourceraw docstring

indent-lines-withclj/s

(indent-lines-with indent-str txt)

Inputs: [indent-str :- s/Str txt :- s/Str] Returns: s/Str

Splits out each line of txt using clojure.string/split-lines, then indents each line by prepending it with the supplied string. Joins lines together into a single string result, with each line terminated by a single ewline.

Inputs: [indent-str :- s/Str txt :- s/Str]
  Returns: s/Str

  Splits out each line of txt using clojure.string/split-lines, then
  indents each line by prepending it with the supplied string. Joins lines together into
  a single string result, with each line terminated by a single 
ewline.
sourceraw docstring

index-usingclj/s

(index-using pred coll)

Finds the first index N where (< N (count coll)) such that (pred (drop N coll)) is truthy. Returns nil if no match found.

Finds the first index N where (< N (count coll)) such that (pred (drop N coll)) is truthy.
Returns `nil` if no match found.
sourceraw docstring

indexedclj/s

(indexed & colls)

Given one or more collections, returns a sequence of indexed tuples from the collections:

(indexed xs ys zs) -> [ [0 x0 y0 z0] [1 x1 y1 z1] [2 x2 y2 z2] ... ]

Given one or more collections, returns a sequence of indexed tuples from the collections:

(indexed xs ys zs) -> [ [0 x0 y0 z0]
                        [1 x1 y1 z1]
                        [2 x2 y2 z2]
                        ... ]
                        
sourceraw docstring

insert-atclj/s

(insert-at coll index elem)

Inputs: [coll :- tsk/List index :- s/Int elem :- s/Any] Returns: tsk/List

Inserts an element into a collection at the specified index.

Inputs: [coll :- tsk/List index :- s/Int elem :- s/Any]
Returns: tsk/List

Inserts an element into a collection at the specified index.
sourceraw docstring

int->kwclj/s

(int->kw arg)
source

int-neg?clj/s

(int-neg? arg)

Inputs: [arg] Returns: s/Bool

Returns true iff x is an integer and is negative

Inputs: [arg]
Returns: s/Bool

Returns true iff x is an integer and is negative
sourceraw docstring

int-nonneg?clj/s

(int-nonneg? arg)

Inputs: [arg] Returns: s/Bool

Returns true iff x is an integer and is not negative

Inputs: [arg]
Returns: s/Bool

Returns true iff x is an integer and is not negative
sourceraw docstring

int-nonpos?clj/s

(int-nonpos? arg)

Inputs: [arg] Returns: s/Bool

Returns true iff x is an integer and is not positive

Inputs: [arg]
Returns: s/Bool

Returns true iff x is an integer and is not positive
sourceraw docstring

int-pos?clj/s

(int-pos? arg)

Inputs: [arg] Returns: s/Bool

Returns true iff x is an integer and is positive

Inputs: [arg]
Returns: s/Bool

Returns true iff x is an integer and is positive
sourceraw docstring

int-val?clj

(int-val? x)

Returns true iff arg is an integer value of any Clojure/Java type (all int types, float/double, BigInt/BigInteger, BigDecimal, clojure.lang.Ratio).

Returns true iff arg is an integer value of any Clojure/Java type
(all int types, float/double, BigInt/BigInteger, BigDecimal, clojure.lang.Ratio).
sourceraw docstring

is-clojure-1-10-plus?clj

(is-clojure-1-10-plus?)
source

is-clojure-1-7-plus?clj

(is-clojure-1-7-plus?)
source

is-clojure-1-8-plus?clj

(is-clojure-1-8-plus?)
source

is-clojure-1-9-plus?clj

(is-clojure-1-9-plus?)
source

is-java-1-7-plus?clj

(is-java-1-7-plus?)
source

is-java-1-7?clj

(is-java-1-7?)
source

is-java-1-8-plus?clj

(is-java-1-8-plus?)
source

is-java-1-8?clj

(is-java-1-8?)
source

is-pre-clojure-1-10?clj

(is-pre-clojure-1-10?)
source

is-pre-clojure-1-8?clj

(is-pre-clojure-1-8?)
source

is-pre-clojure-1-9?clj

(is-pre-clojure-1-9?)
source

it->clj/smacro

(it-> expr & forms)

A threading macro like as-> that always uses the symbol 'it' as the placeholder for the next threaded value:

(it-> 1 (inc it) (+ it 3) (/ 10 it)) ;=> 2

A threading macro like as-> that always uses the symbol 'it' as the placeholder for the next threaded value:

(it-> 1
      (inc it)
      (+ it 3)
      (/ 10 it))
;=> 2 
sourceraw docstring

java-versionclj

(java-version)

Inputs: [] Returns: s/Str

Inputs: []
Returns: s/Str
sourceraw docstring

java-version-matches?clj

(java-version-matches? version-str)

Inputs: [version-str :- s/Str] Returns: s/Bool

Returns true if Java version exactly matches supplied string.

Inputs: [version-str :- s/Str]
Returns: s/Bool

Returns true if Java version exactly matches supplied string.
sourceraw docstring

java-version-min?clj

(java-version-min? version-str)

Inputs: [version-str :- s/Str] Returns: s/Bool

Returns true if Java version is at least as great as supplied string. Sort is by lexicographic (alphabetic) order.

Inputs: [version-str :- s/Str]
Returns: s/Bool

Returns true if Java version is at least as great as supplied string.
     Sort is by lexicographic (alphabetic) order.
sourceraw docstring

json->ednclj/s≠

(json->edn json-str)
clj

Inputs: [json-str :- s/Str]

Shortcut to cheshire.core/parse-string

Inputs: [json-str :- s/Str]

Shortcut to cheshire.core/parse-string
cljs

Inputs: [json-str :- s/Str]

Convert from json -> edn

Inputs: [json-str :- s/Str]

Convert from json -> edn
source (clj)source (cljs)raw docstring

keep-ifclj/s

(keep-if pred coll)

Returns a vector of items in coll for which (pred item) is true (alias for clojure.core/filter)

Returns a vector of items in coll for which (pred item) is true (alias for clojure.core/filter)
sourceraw docstring

keyvalsclj/s

(keyvals m)

Inputs: [m :- tsk/Map] Returns: [s/Any]

For any map m, returns the (alternating) keys & values of m as a vector, suitable for reconstructing m via (apply hash-map (keyvals m)). (keyvals {:a 1 :b 2} => [:a 1 :b 2]

Inputs: [m :- tsk/Map]
Returns: [s/Any]

For any map m, returns the (alternating) keys & values of m as a vector, suitable for reconstructing m via
 (apply hash-map (keyvals m)). (keyvals {:a 1 :b 2} => [:a 1 :b 2] 
sourceraw docstring

keyvals-seqclj/s≠

clj
(keyvals-seq ctx)
(keyvals-seq the-map the-keys)
cljs
(keyvals-seq G__113118)
(keyvals-seq G__113122 G__113123)

Inputs: ([ctx :- tsk/KeyMap] [the-map :- tsk/KeyMap the-keys :- [s/Any]]) Returns: [s/Any]

For any map m, returns the (alternating) keys & values of m as a vector, suitable for reconstructing m via (apply hash-map (keyvals m)). (keyvals {:a 1 :b 2} => [:a 1 :b 2]

   Usage:  (keyvals-seq ctx) ctx-default: {:missing-ok false}
           (keyvals-seq the-map the-keys) 
Inputs: ([ctx :- tsk/KeyMap] [the-map :- tsk/KeyMap the-keys :- [s/Any]])
Returns: [s/Any]

For any map m, returns the (alternating) keys & values of m as a vector, suitable for reconstructing m via
 (apply hash-map (keyvals m)). (keyvals {:a 1 :b 2} => [:a 1 :b 2]

       Usage:  (keyvals-seq ctx) ctx-default: {:missing-ok false}
               (keyvals-seq the-map the-keys) 
sourceraw docstring

kw->intclj/s

(kw->int arg)
source (clj)source (cljs)

kw->strclj/s

(kw->str arg)

Inputs: [arg :- s/Keyword] Returns: s/Str

Converts a keyword to a string

Inputs: [arg :- s/Keyword]
Returns: s/Str

Converts a keyword to a string
sourceraw docstring

kw->symclj/s

(kw->sym arg)

Inputs: [arg :- s/Keyword] Returns: s/Symbol

Converts a keyword to a symbol

Inputs: [arg :- s/Keyword]
Returns: s/Symbol

Converts a keyword to a symbol
sourceraw docstring

last-or-nilclj/s

(last-or-nil seq-arg)

Returns the last item in a sequence, or nil

Returns the last item in a sequence, or nil
sourceraw docstring

lazy-consclj/smacro

(lazy-cons curr-val recursive-call-form)

The simple way to create a lazy sequence:

(defn lazy-next-int [n] (t/lazy-cons n (lazy-next-int (inc n)))) (def all-ints (lazy-next-int 0))

The simple way to create a lazy sequence:

(defn lazy-next-int [n]
  (t/lazy-cons n (lazy-next-int (inc n))))
(def all-ints (lazy-next-int 0))
sourceraw docstring

lazy-genclj/smacro

(lazy-gen & forms)

Creates a 'generator function' that returns a lazy seq of results via yield (a la Python).

Creates a 'generator function' that returns a lazy seq of results
via `yield` (a la Python).
sourceraw docstring

let-someclj/smacro

(let-some bindings & forms)

Threads forms as with when-some, but allow more than 1 pair of binding forms.

Threads forms as with `when-some`, but allow more than 1 pair of binding forms.
sourceraw docstring

let-spyclj/smacro

(let-spy & exprs)

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied expressions, printing both the expression and its value to stdout. Returns the value of the last expression.

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied
expressions, printing both the expression and its value to stdout. Returns the value of the
last expression.
sourceraw docstring

let-spy-prettyclj/smacro

(let-spy-pretty & exprs)

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied expressions, printing both the expression and its value to stdout. Returns the value of the last expression.

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied
expressions, printing both the expression and its value to stdout. Returns the value of the
last expression.
sourceraw docstring

let-spyxxclj/smacro

(let-spyxx & exprs)

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied expressions, printing both the expression and its value to stdout. Returns the value of the last expression.

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied
expressions, printing both the expression and its value to stdout. Returns the value of the
last expression.
sourceraw docstring

list->entriesclj/s

(list->entries data)

Inputs: [data :- tsk/Vec] Returns: [tsk/Map]

Returns a vector of list-entry maps given a vector/list

Inputs: [data :- tsk/Vec]
Returns: [tsk/Map]

Returns a vector of list-entry maps given a vector/list
sourceraw docstring

list-entries->vecclj/s

(list-entries->vec list-entries)

Inputs: [list-entries :- tsk/Vec] Returns: tsk/Vec

Inputs: [list-entries :- tsk/Vec]
Returns: tsk/Vec
sourceraw docstring

list-entryclj/s

(list-entry idx val)

Constructs a list-entry map given an index and value

Constructs a list-entry map given an index and value
sourceraw docstring

list-entry?clj/s

(list-entry? arg)

Returns true iff the arg is a list-entry

Returns true iff the arg is a list-entry
sourceraw docstring

listy?clj/s

(listy? arg)

Returns true if arg is a list or a seq, else false.

Returns true if arg is a list or a seq, else false.
sourceraw docstring

macro?clj

(macro? s)

Returns true if a quoted symbol resolves to a macro. Usage:

(println (macro? 'and)) ;=> true

Returns true if a quoted symbol resolves to a macro. Usage:

(println (macro? 'and))  ;=> true 
sourceraw docstring

map-entryclj/s

(map-entry key val)

Inputs: [key val] Returns: tsk/MapEntry

Returns a clojure.lang.MapEntry constructed from the given key and val

Inputs: [key val]
Returns: tsk/MapEntry

Returns a clojure.lang.MapEntry constructed from the given key and val
sourceraw docstring

map-keysclj/s≠

clj
(map-keys map-in tx-fn & tx-args)
cljs
(map-keys G__113156 G__113157 & rest113158)

Inputs: [map-in :- tsk/Map tx-fn :- tsk/Fn & tx-args] Returns: tsk/Map

Transforms each key in a map using the supplied tx-fn:

  (t/map-keys {1 :a 2 :b 3 :c} inc)                  =>  {  2 :a   3 :b 4   :c}
  (t/map-keys {1 :a 2 :b 3 :c} {1 101 2 202 3 303})  =>  {101 :a 202 :b 303 :c}
Inputs: [map-in :- tsk/Map tx-fn :- tsk/Fn & tx-args]
Returns: tsk/Map

Transforms each key in a map using the supplied `tx-fn`:

      (t/map-keys {1 :a 2 :b 3 :c} inc)                  =>  {  2 :a   3 :b 4   :c}
      (t/map-keys {1 :a 2 :b 3 :c} {1 101 2 202 3 303})  =>  {101 :a 202 :b 303 :c}
sourceraw docstring

map-letclj/smacro

(map-let bindings & forms)

Usage: (map-let bindings & forms)

Given bindings and forms like (map-let [x xs, y ys, ...] (+ x y)), will iterate over the collections [xs ys ...] assigning successive values of each collection to [x y ...], respectively. The local symbols [x y ...] can then be used in forms to generate the output mapping. Will throw if collections are not all of the same length. Not lazy.

Usage:
  (map-let bindings & forms)

Given bindings and forms like `(map-let [x xs, y ys, ...] (+ x y))`, will iterate over the
collections [xs ys ...] assigning successive values of each collection to [x y ...], respectively.
The local symbols [x y ...] can then be used in `forms` to generate the output mapping.
Will throw if collections are not all of the same length. Not lazy.
sourceraw docstring

map-let*clj/smacro

(map-let* context bindings & forms)

Usage: (map-let* ctx bindings & forms)

where ctx is a map with default values: {:strict true :lazy false}

Usage:  (map-let* ctx bindings & forms)

where ctx is a map with default values:
  {:strict true
   :lazy   false}
sourceraw docstring

map-listclj/smacro

(map-list & forms)

Like clojure.core/map but returns results in an eager list. Not lazy.

Like clojure.core/map but returns results in an eager list. Not lazy.
sourceraw docstring

map-plain?clj/s

(map-plain? arg)

Inputs: [arg :- s/Any] Returns: s/Bool

Like clojure.core/map?, but returns false for records.

Inputs: [arg :- s/Any]
Returns: s/Bool

Like clojure.core/map?, but returns false for records.
sourceraw docstring

map-valsclj/s≠

clj
(map-vals map-in tx-fn & tx-args)
cljs
(map-vals G__113176 G__113177 & rest113178)

Inputs: [map-in :- tsk/Map tx-fn :- tsk/Fn & tx-args] Returns: tsk/Map

Transforms each value in a map using the supplied tx-fn:

  (t/map-vals {:a 1 :b 2 :c 3} inc)                  =>  {:a 2,   :b 3,   :c 4}
  (t/map-vals {:a 1 :b 2 :c 3} {1 101 2 202 3 303})  =>  {:a 101, :b 202, :c 303} 
Inputs: [map-in :- tsk/Map tx-fn :- tsk/Fn & tx-args]
Returns: tsk/Map

Transforms each value in a map using the supplied `tx-fn`:

      (t/map-vals {:a 1 :b 2 :c 3} inc)                  =>  {:a 2,   :b 3,   :c 4}
      (t/map-vals {:a 1 :b 2 :c 3} {1 101 2 202 3 303})  =>  {:a 101, :b 202, :c 303} 
sourceraw docstring

MapKeySpecclj/s

source

matches?clj/smacro

(matches? pattern & values)

A shortcut to clojure.core.match/match to aid in testing. Returns true if the data value matches the pattern value. Underscores serve as wildcard values. Usage:

(matches? pattern & values)

sample:

(matches? [1 _ 3] [1 2 3] ) ;=> true (matches? {:a _ :b _ :c 3} {:a 1 :b [1 2 3] :c 3} {:a 2 :b 99 :c 3} {:a 3 :b nil :c 3} ) ;=> true

Note that a wildcald can match either a primitive or a composite value.

A shortcut to clojure.core.match/match to aid in testing.  Returns true if the data value
matches the pattern value.  Underscores serve as wildcard values. Usage:

  (matches? pattern & values)

sample:

  (matches?  [1 _ 3] [1 2 3] )         ;=> true
  (matches?  {:a _ :b _       :c 3}
             {:a 1 :b [1 2 3] :c 3}
             {:a 2 :b 99      :c 3}
             {:a 3 :b nil     :c 3} )  ;=> true

Note that a wildcald can match either a primitive or a composite value.
sourceraw docstring

nlclj/s

(nl & args)

Abbreviated name for newline. Accepts varargs to be printed 1 per line after initial newline.

Abbreviated name for `newline`.  Accepts varargs to be printed 1 per line after initial newline. 
sourceraw docstring

nonneg?clj/s

(nonneg? arg)

Inputs: [arg] Returns: s/Bool

Returns true iff x is not negative

Inputs: [arg]
Returns: s/Bool

Returns true iff x is not negative
sourceraw docstring

nonpos?clj/s

(nonpos? arg)

Inputs: [arg] Returns: s/Bool

Returns true iff x is not positive

Inputs: [arg]
Returns: s/Bool

Returns true iff x is not positive
sourceraw docstring

noopclj/s

A function that accepts any number of args, does nothing, and returns nil.

A function that accepts any number of args, does nothing, and returns `nil`.
sourceraw docstring

not-empty?clj/s

(not-empty? coll)

Inputs: [coll] Returns: s/Bool

For any collection coll, returns true if coll contains any items; otherwise returns false. Equivalent to (not (empty? coll)).

Inputs: [coll]
Returns: s/Bool

For any collection coll, returns true if coll contains any items; otherwise returns false.
 Equivalent to (not (empty? coll)).
sourceraw docstring

not-nil?clj/s

(not-nil? arg)

Inputs: [arg :- s/Any] Returns: s/Bool

Returns true if arg is not nil; false otherwise. Equivalent to (not (nil? arg)), or the poorly-named clojure.core/some?

Inputs: [arg :- s/Any]
Returns: s/Bool

Returns true if arg is not nil; false otherwise. Equivalent to (not (nil? arg)),
 or the poorly-named clojure.core/some? 
sourceraw docstring

onliesclj/s

(onlies coll)

Given an outer collection of length-1 collections, returns a sequence of the unwrapped values. (onlies [ [1] [2] [3] ]) => [1 2 3] (onlies #{ [1] [2] [3] }) => #{1 2 3}

Given an outer collection of length-1 collections, returns a sequence of the unwrapped values.
(onlies  [ [1] [2] [3] ])  =>  [1 2 3]
(onlies #{ [1] [2] [3] })  => #{1 2 3} 
sourceraw docstring

onlyclj/s

(only coll)

Ensures that a sequence is of length=1, and returns the only value present. Throws an exception if the length of the sequence is not one. Note that, for a length-1 sequence S, (first S), (last S) and (only S) are equivalent.

Ensures that a sequence is of length=1, and returns the only value present.
Throws an exception if the length of the sequence is not one.
Note that, for a length-1 sequence S, (first S), (last S) and (only S) are equivalent.
sourceraw docstring

only2clj/s

(only2 coll)

Given a collection like [[5]], returns 5. Equivalent to (only (only coll)).

Given a collection like `[[5]]`, returns `5`.  Equivalent to `(only (only coll))`.
sourceraw docstring

only2?clj/s

(only2? coll)

Inputs: [coll :- s/Any] Returns: s/Bool

Returns true iff arg is two nested collections of length=1

Inputs: [coll :- s/Any]
Returns: s/Bool

Returns true iff arg is two nested collections of length=1
sourceraw docstring

only?clj/s

(only? coll)

Inputs: [coll :- s/Any] Returns: s/Bool

Returns true iff collection has length=1

Inputs: [coll :- s/Any]
Returns: s/Bool

Returns true iff collection has length=1
sourceraw docstring

pair?clj/s

(pair? coll)

Returns true if the collection contains exactly 2 items.

Returns true if the collection contains exactly 2 items.
sourceraw docstring

partition-usingclj/s

(partition-using pred coll)

Inputs: [pred :- s/Any coll :- tsk/List]

Partitions a collection into vector of segments based on a predicate with a collection argument. The first segment is initialized by removing the first element from coll, with subsequent elements similarly transferred as long as (pred remaining-coll) is falsey. When (pred remaining-coll) becomes truthy, the algorithm begins building the next segment. Thus, the first partition finds the smallest N (< 0 N) such that (pred (drop N coll)) is true, and constructs the segment as (take N coll). If pred is never satisified, [coll] is returned.

Inputs: [pred :- s/Any coll :- tsk/List]

Partitions a collection into vector of segments based on a predicate with a collection argument.
The first segment is initialized by removing the first element from `coll`, with subsequent
elements similarly transferred as long as `(pred remaining-coll)` is falsey. When
`(pred remaining-coll)` becomes truthy, the algorithm begins building the next segment.
Thus, the first partition finds the smallest N (< 0 N) such that (pred (drop N coll))
is true, and constructs the segment as (take N coll). If pred is never satisified,
[coll] is returned.
sourceraw docstring

prependclj/s≠

clj
(prepend & args)
cljs
(prepend & rest112691)

Inputs: [& args] Returns: tsk/List

Given a sequential object (vector or list), add one or more elements to the beginning

Inputs: [& args]
Returns: tsk/List

Given a sequential object (vector or list), add one or more elements to the beginning
sourceraw docstring

prettifyclj/s

(prettify coll)

Recursively walks a data structure and returns a prettified version. Converts all lists to vectors. Converts all maps & sets to sorted collections.

Recursively walks a data structure and returns a prettified version.
Converts all lists to vectors. Converts all maps & sets to sorted collections.
sourceraw docstring

prettyclj/s

(pretty arg)
(pretty arg writer)

Shortcut to clojure.pprint/pprint. Returns it (1st) argument.

Shortcut to clojure.pprint/pprint. Returns it (1st) argument.
sourceraw docstring

pretty-strclj/s

(pretty-str arg)

Returns a string that is the result of clojure.pprint/pprint

Returns a string that is the result of clojure.pprint/pprint
sourceraw docstring

(print-versions)
source

quad?clj/s

(quad? coll)

Returns true if the collection contains exactly 4 items.

Returns true if the collection contains exactly 4 items.
sourceraw docstring

rand-elemclj/s

(rand-elem coll)

Returns a random element from a collection

Returns a random element from a collection
sourceraw docstring

range-vecclj/s

(range-vec & args)

An eager version clojure.core/range that always returns its result in a vector.

An eager version clojure.core/range that always returns its result in a vector.
sourceraw docstring

rel=clj/s

(rel= val1 val2 & {:as opts})

Returns true if 2 double-precision numbers are relatively equal, else false. Relative equality is specified as either (1) the N most significant digits are equal, or (2) the absolute difference is less than a tolerance value. Input values are coerced to double before comparison. Example:

(rel= 123450000 123456789 :digits 4 ) ; true (rel= 1 1.001 :tol 0.01) ; true

Returns true if 2 double-precision numbers are relatively equal, else false.  Relative equality
is specified as either (1) the N most significant digits are equal, or (2) the absolute
difference is less than a tolerance value.  Input values are coerced to double before comparison.
Example:

  (rel= 123450000 123456789   :digits 4   )  ; true
  (rel= 1         1.001       :tol    0.01)  ; true
sourceraw docstring

replace-atclj/s

(replace-at coll index elem)

Inputs: [coll :- tsk/List index :- s/Int elem :- s/Any] Returns: tsk/List

Replaces an element in a collection at the specified index.

Inputs: [coll :- tsk/List index :- s/Int elem :- s/Any]
Returns: tsk/List

Replaces an element in a collection at the specified index.
sourceraw docstring

rest-or-emptyclj/s

(rest-or-empty seq-arg)

Returns a sequence with the first item removed, or a zero-length seq if there are no more items

Returns a sequence with the first item removed, or a zero-length seq if there are no more items
sourceraw docstring

rest-or-nilclj/s

(rest-or-nil seq-arg)

Returns a sequence with the first item removed, or nil if there are no more items

Returns a sequence with the first item removed, or nil if there are no more items
sourceraw docstring

restructclj/s

(restruct & args)

within a (destruct [<data> <shape>] ...) form,(restruct)or(restruct <data>)` causes re-structuring & return of original data shape using current values.

within a `(destruct [<data> <shape>] ...) form, `(restruct)` or `(restruct <data>)` causes re-structuring
& return of original data shape using current values.
sourceraw docstring

restruct-allclj/s

(restruct-all & args)

within a `(destruct [data-1 <shape-1> data-2 <shape-2] ...) form, causes re-structuring & return of original data shapes using current values as with (vals->map data-1 data-2 ...)

within a `(destruct [data-1 <shape-1>
                      data-2 <shape-2] ...) form, causes re-structuring & return of original data shapes using
current values as with (vals->map data-1 data-2 ...)
sourceraw docstring

second-or-nilclj/s

(second-or-nil seq-arg)

Returns the second item in a sequence, or nil

Returns the second item in a sequence, or nil
sourceraw docstring

seq->strclj/s

(seq->str seq-in)

Convert a seq into a string (using pr) with a space preceding each value

Convert a seq into a string (using pr) with a space preceding each value
sourceraw docstring

sequential->idx-mapclj/s

(sequential->idx-map data)

Inputs: [data :- [s/Any]] Returns: #:s{Any s/Any}

Inputs: [data :- [s/Any]]
Returns: #:s{Any s/Any}
sourceraw docstring

set-match-ctx?clj/s

(set-match-ctx? ctx-in pattern & values)
source

set-match?clj/s

(set-match? pattern & values)
source

set=clj/s≠

clj
(set= & colls)
cljs
(set= & rest113237)

Inputs: [& colls] Returns: s/Bool

Returns true if the collections are equal when converted to sets.

Inputs: [& colls]
Returns: s/Bool

Returns true if the collections are equal when converted to sets.
sourceraw docstring

single?clj/s

(single? coll)

Returns true if the collection contains a single item.`

Returns true if the collection contains a single item.`
sourceraw docstring

some-it->clj/smacro

(some-it-> expr & forms)

Threads forms as with it->, terminates & returns nil if any expression is nil.

Threads forms as with `it->`, terminates & returns `nil` if any expression is nil.
sourceraw docstring

sorted-map-genericclj/s

(sorted-map-generic)

Returns a generic sorted map, able to accept keys of different classes

Returns a generic sorted map, able to accept keys of different classes
sourceraw docstring

sorted-map-via-pathclj/s≠

clj
(sorted-map-via-path src-map path-vec)
(sorted-map-via-path src-map path-vec ascending?)
cljs
(sorted-map-via-path G__112874 G__112875)
(sorted-map-via-path G__112879 G__112880 G__112881)

Inputs: ([src-map :- tsk/Map path-vec :- tsk/Vec] [src-map :- tsk/Map path-vec :- tsk/Vec ascending? :- s/Bool]) Returns: tsk/Map


***** WARNING: due to a bug in clojure.core/sorted-map-by, ***** ***** this crashes if namespaced keys are used. *****


Given a source map, returns a sorted version of the same map. The value to sort by is specified via a path vector as with clojure.core/get-in, where the first element is always specified as :*, since the path must work for every top-level key in <src-map>. The sorting value must be acceptable to clojure.core/compare. Defaults to ascending sort order. Returns an instance of clojure.data.avl.AVLMap. NOTE: because of peculiarities of clojure.core/sorted-map-by, one cannot add new entries to the sorted map. Instead, a new map must be created from a plain map. Usage:

(sorted-map-via <src-map> <path-vec>)
(sorted-map-via <src-map> <path-vec> <ascending?>)

Example:

(let [unsorted {:c {:val 3}
                :a {:val 1}
                :b {:val 2}}
      sorted   (sorted-map-via unsorted [:* :val])]
  (assert (= unsorted sorted))) 
Inputs: ([src-map :- tsk/Map path-vec :- tsk/Vec] [src-map :- tsk/Map path-vec :- tsk/Vec ascending? :- s/Bool])
Returns: tsk/Map


*************************************************************************
***** WARNING:  due to a bug in clojure.core/sorted-map-by,         *****
*****           this crashes if namespaced keys are used.           *****
*************************************************************************

Given a source map, returns a sorted version of the same map. The value to sort
by is specified via a path vector as with `clojure.core/get-in`, where the first
element is always specified as `:*`, since the path must work for every top-level key
in <src-map>. The sorting value must be acceptable to clojure.core/compare.
Defaults to ascending sort order.  Returns an instance of `clojure.data.avl.AVLMap`.
NOTE:  because of peculiarities of clojure.core/sorted-map-by, one cannot add new entries
to the sorted map.  Instead, a new map must be created from a plain map.
Usage:

    (sorted-map-via <src-map> <path-vec>)
    (sorted-map-via <src-map> <path-vec> <ascending?>)

Example:

    (let [unsorted {:c {:val 3}
                    :a {:val 1}
                    :b {:val 2}}
          sorted   (sorted-map-via unsorted [:* :val])]
      (assert (= unsorted sorted))) 
sourceraw docstring

sorted-set-genericclj/s

(sorted-set-generic)

Returns a generic sorted set, able to accept keys of different classes

Returns a generic sorted set, able to accept keys of different classes
sourceraw docstring

split-matchclj/s

(split-match coll tgt)

Splits a collection src by matching with a sub-sequence tgt of length L. Finds the first index N such that (= tgt (->> coll (drop N) (take L))) is true. Returns a length-2 vector of [ (take N coll) (drop N coll) ]. If no match is found, [ coll [] ] is returned.

Splits a collection src by matching with a sub-sequence tgt of length L.
Finds the first index N such that (= tgt (->> coll (drop N) (take L))) is true.
Returns a length-2 vector of [ (take N coll) (drop N coll) ].
If no match is found, [ coll [] ] is returned.
sourceraw docstring

split-usingclj/s

(split-using pred coll)

Splits a collection based on a predicate with a collection argument. Finds the first index N such that (pred (drop N coll)) is true. Returns a length-2 vector of [ (take N coll) (drop N coll) ]. If pred is never satisified, [ coll [] ] is returned.

Splits a collection based on a predicate with a collection argument.
Finds the first index N such that (pred (drop N coll)) is true. Returns a length-2 vector
of [ (take N coll) (drop N coll) ]. If pred is never satisified, [ coll [] ] is returned.
sourceraw docstring

spyclj/s

(spy value)
(spy arg1 arg2)

A form of (println ...) to ease debugging display of either intermediate values in threading forms or function return values. There are three variants. Usage:

(spy :msg <msg-string>)

This variant is intended for use in either thread-first (->) or thread-last (->>) forms. The keyword :msg is used to identify the message string and works equally well for both the -> and ->> operators. Spy prints both <msg-string> and the threading value to stdout, then returns the value for further propogation in the threading form. For example, both of the following:

     (->   2
           (+ 3)
           (spy :msg "sum" )
           (* 4))
     (->>  2
           (+ 3)
           (spy :msg "sum" )
           (* 4))

 will print 'sum => 5' to stdout.

(spy <msg-string> <value>) This variant is intended for simpler use cases such as function return values. Function return value expressions often invoke other functions and cannot be easily displayed since (println ...) swallows the return value and returns nil itself. Spy will output both <msg-string> and the value, then return the value for use by further processing. For example, the following:

     (println (* 2
                (spy "sum" (+ 3 4))))

will print:

     sum => 7
     14

to stdout.

(spy <value>) This variant is intended for use in very simple situations and is the same as the 2-argument arity where <msg-string> defaults to 'spy'. For example (spy (+ 2 3)) prints 'spy => 5' to stdout.

A form of (println ...) to ease debugging display of either intermediate values in threading
forms or function return values. There are three variants.  Usage:

 (spy :msg <msg-string>)

   This variant is intended for use in either thread-first (->) or thread-last (->>)
   forms.  The keyword :msg is used to identify the message string and works equally
   well for both the -> and ->> operators. Spy prints both <msg-string>  and the
   threading value to stdout, then returns the value for further propogation in the
   threading form. For example, both of the following:

         (->   2
               (+ 3)
               (spy :msg "sum" )
               (* 4))
         (->>  2
               (+ 3)
               (spy :msg "sum" )
               (* 4))

     will print 'sum => 5' to stdout.

 (spy <msg-string> <value>)
   This variant is intended for simpler use cases such as function return values.
   Function return value expressions often invoke other functions and cannot be
   easily displayed since (println ...) swallows the return value and returns nil
   itself.  Spy will output both <msg-string> and the value, then return the value
   for use by further processing.  For example, the following:

         (println (* 2
                    (spy "sum" (+ 3 4))))
   will print:

         sum => 7
         14

   to stdout.

 (spy <value>)
     This variant is intended for use in very simple situations and is the same as the
     2-argument arity where <msg-string> defaults to 'spy'.  For example (spy (+ 2 3))
     prints 'spy => 5' to stdout.  
sourceraw docstring

spy-indent-resetclj/s

(spy-indent-reset)

Reset the spy indent level to zero.

Reset the spy indent level to zero.
sourceraw docstring

spy-prettyclj/smacro

(spy-pretty & exprs)

Like spyx-pretty but without printing the original form

Like `spyx-pretty` but without printing the original form
sourceraw docstring

spydivclj/s

(spydiv)
source

spyqclj/s

(spyq value)

(spyq <value>) - Spy Quiet This variant is intended for use in very simple situations and is the same as the 2-argument arity where <msg-string> defaults to 'spy'. For example (spy (+ 2 3)) prints 'spy => 5' to stdout.

(spyq <value>) - Spy Quiet
This variant is intended for use in very simple situations and is the same as the
2-argument arity where <msg-string> defaults to 'spy'.  For example (spy (+ 2 3))
prints 'spy => 5' to stdout.  
sourceraw docstring

spyxclj/smacro

(spyx & exprs)

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied expressions, printing both the expression and its value to stdout. Returns the value of the last expression.

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied
expressions, printing both the expression and its value to stdout. Returns the value of the
last expression.
sourceraw docstring

spyx-prettyclj/smacro

(spyx-pretty & exprs)

Like spyx but with pretty printing (clojure.pprint/pprint)

Like `spyx` but with pretty printing (clojure.pprint/pprint)
sourceraw docstring

spyxxclj/smacro

(spyxx expr)

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied expression, printing both the expression, its type, and its value to stdout, then returns the value.

An expression (println ...) for use in threading forms (& elsewhere). Evaluates the supplied
expression, printing both the expression, its type, and its value to stdout, then returns the value.
sourceraw docstring

starts-with?clj/s

(starts-with? coll tgt-in)

Inputs: [coll tgt-in] Returns: s/Bool

Returns true when the initial elements of coll match those of tgt

Inputs: [coll tgt-in]
Returns: s/Bool

Returns true when the initial elements of coll match those of tgt
sourceraw docstring

str->charsclj/s

(str->chars arg)

Inputs: [arg :- s/Str] Returns: [s/Any]

Converts a string to a vector of chars

Inputs: [arg :- s/Str]
Returns: [s/Any]

Converts a string to a vector of chars
sourceraw docstring

str->kwclj/s

(str->kw arg)

Inputs: [arg :- s/Str] Returns: s/Keyword

Converts a string to a keyword

Inputs: [arg :- s/Str]
Returns: s/Keyword

Converts a string to a keyword
sourceraw docstring

str->symclj/s

(str->sym arg)

Inputs: [arg :- s/Str] Returns: s/Symbol

Converts a string to a symbol

Inputs: [arg :- s/Str]
Returns: s/Symbol

Converts a string to a symbol
sourceraw docstring

strcatclj/s

(strcat & args)

Recursively concatenate all arguments into a single string result.

Recursively concatenate all arguments into a single string result.
sourceraw docstring

sublistclj

(sublist listy idx-low)
(sublist listy idx-low idx-bound)

Inputs: ([listy :- tsk/List idx-low :- s/Int] [listy :- tsk/List idx-low :- s/Int idx-bound :- s/Int]) Returns: tsk/List

Like clojure.core/subvec, but works for any sequence (remniscent of java.util.List/subList)

Inputs: ([listy :- tsk/List idx-low :- s/Int] [listy :- tsk/List idx-low :- s/Int idx-bound :- s/Int])
Returns: tsk/List

Like clojure.core/subvec, but works for any sequence (remniscent of java.util.List/subList)
sourceraw docstring

submap-by-keysclj/s≠

clj
(submap-by-keys map-arg keep-keys & opts)
cljs
(submap-by-keys G__113064 G__113065 & rest113066)

Inputs: [map-arg :- tsk/Map keep-keys :- (s/if set? tsk/Set tsk/List) & opts] Returns: tsk/Map

Returns a new map containing entries with the specified keys. Throws for missing keys, unless :missing-ok is specified. Usage:

(submap-by-keys {:a 1 :b 2} #{:a   }             )  =>  {:a 1}
(submap-by-keys {:a 1 :b 2} #{:a :z} :missing-ok )  =>  {:a 1}
Inputs: [map-arg :- tsk/Map keep-keys :- (s/if set? tsk/Set tsk/List) & opts]
Returns: tsk/Map

Returns a new map containing entries with the specified keys. Throws for missing keys,
unless `:missing-ok` is specified. Usage:

    (submap-by-keys {:a 1 :b 2} #{:a   }             )  =>  {:a 1}
    (submap-by-keys {:a 1 :b 2} #{:a :z} :missing-ok )  =>  {:a 1}
sourceraw docstring

submap-by-valsclj/s≠

clj
(submap-by-vals map-arg keep-vals & opts)
cljs
(submap-by-vals G__113084 G__113085 & rest113086)

Inputs: [map-arg :- tsk/Map keep-vals :- (s/if set? tsk/Set tsk/List) & opts] Returns: tsk/Map

Returns a new map containing entries with the specified vals. Throws for missing vals, unless :missing-ok is specified. Usage:

(submap-by-vals {:a 1 :b 2 :A 1} #{1  }             )  =>  {:a 1 :A 1}
(submap-by-vals {:a 1 :b 2 :A 1} #{1 9} :missing-ok )  =>  {:a 1 :A 1} 
Inputs: [map-arg :- tsk/Map keep-vals :- (s/if set? tsk/Set tsk/List) & opts]
Returns: tsk/Map

Returns a new map containing entries with the specified vals. Throws for missing vals,
unless `:missing-ok` is specified. Usage:

    (submap-by-vals {:a 1 :b 2 :A 1} #{1  }             )  =>  {:a 1 :A 1}
    (submap-by-vals {:a 1 :b 2 :A 1} #{1 9} :missing-ok )  =>  {:a 1 :A 1} 
sourceraw docstring

submap?clj/s

(submap? inner-map outer-map)

Inputs: [inner-map :- #:s{Any s/Any} outer-map :- #:s{Any s/Any}] Returns: s/Bool

Returns true if the map entries (key-value pairs) of one map are a subset of the entries of another map. Similar to clojure.set/subset?

Inputs: [inner-map :- #:s{Any s/Any} outer-map :- #:s{Any s/Any}]
Returns: s/Bool

Returns true if the map entries (key-value pairs) of one map are a subset of the entries of
 another map.  Similar to clojure.set/subset?
sourceraw docstring

submatch?clj/s

(submatch? smaller larger)

Returns true if the first arg is (recursively) a subset/submap/subvec of the 2nd arg

Returns true if the first arg is (recursively) a subset/submap/subvec of the 2nd arg
sourceraw docstring

swap-out!clj

(swap-out! tgt-atom swap-fn & args)

Just like clojure.core/swap!, but returns the old value

Just like clojure.core/swap!, but returns the old value
sourceraw docstring

sym->kwclj/s

(sym->kw arg)

Inputs: [arg :- s/Symbol] Returns: s/Keyword

Converts a symbol to a keyword

Inputs: [arg :- s/Symbol]
Returns: s/Keyword

Converts a symbol to a keyword
sourceraw docstring

sym->strclj/s

(sym->str arg)

Inputs: [arg :- s/Symbol] Returns: s/Str

Converts a symbol to a string

Inputs: [arg :- s/Symbol]
Returns: s/Str

Converts a symbol to a string
sourceraw docstring

take-while-resultclj/s

(take-while-result pred coll)

Inputs: [pred coll] Returns: tsk/List

Takes from a collection based on a predicate with a collection argument. Continues taking from the source collection until (pred <taken-items>) is falsey. If pred is never falsey, coll is returned.

Inputs: [pred coll]
Returns: tsk/List

Takes from a collection based on a predicate with a collection argument.
Continues taking from the source collection until `(pred <taken-items>)` is falsey.
If pred is never falsey, `coll` is returned.
sourceraw docstring

third-or-nilclj/s

(third-or-nil seq-arg)

Returns the third item in a sequence, or nil

Returns the third item in a sequence, or nil
sourceraw docstring

thruclj/s

(thru end)
(thru start end)
(thru start end step)

Returns a sequence of integers. Like clojure.core/rng, but is inclusive of the right boundary value. Not lazy.

Returns a sequence of integers. Like clojure.core/rng, but is inclusive of the right boundary value. Not lazy. 
sourceraw docstring

triple?clj/s

(triple? coll)

Returns true if the collection contains exactly 3 items.

Returns true if the collection contains exactly 3 items.
sourceraw docstring

truthy?clj/s

(truthy? arg)

Returns true if arg is logical true (neither nil nor false); otherwise returns false.

Returns true if arg is logical true (neither nil nor false); otherwise returns false.
sourceraw docstring

try-catchallclj/smacro

(try-catchall & body)

A cross-platform variant of try-catch that catches all exceptions. Does not (yet) support finally, and does not need or want an exception class.

A cross-platform variant of try-catch that catches all exceptions.
Does not (yet) support finally, and does not need or want an exception class.
sourceraw docstring

type-name-strclj/smacro

(type-name-str arg)

Returns the type/class name of a value as a string. Works for both CLJ and CLJS.

Returns the type/class name of a value as a string.  Works for both CLJ and CLJS.
sourceraw docstring

unlazyclj/s

(unlazy coll)

Converts a lazy collection to a concrete (eager) collection of the same type.

Converts a lazy collection to a concrete (eager) collection of the same type.
sourceraw docstring

unnestclj/s≠

clj
(unnest & values)
cljs
(unnest & rest113039)

Inputs: [& values] Returns: [s/Any]

Given any set of arguments including vectors, maps, sets, & scalars, performs a depth-first recursive walk returning scalar args (int, string, keyword, etc) in a single 1-D vector.

Inputs: [& values]
Returns: [s/Any]

Given any set of arguments including vectors, maps, sets, & scalars, performs a depth-first
recursive walk returning scalar args (int, string, keyword, etc) in a single 1-D vector.
sourceraw docstring

unwrapclj/s

(unwrap data)

Inputs: [data :- [s/Any]] Returns: Unwrapped

Works with the ->vector function to unwrap vectors/lists to insert their elements as with the unquote-spicing operator (~@). Examples:

  (->vector 1 2 3 4 5 6 7 8 9)              =>  [1 2 3 4 5 6 7 8 9]
  (->vector 1 2 3 (unwrap [4 5 6]) 7 8 9)   =>  [1 2 3 4 5 6 7 8 9] 
Inputs: [data :- [s/Any]]
Returns: Unwrapped

Works with the `->vector` function to unwrap vectors/lists to insert
their elements as with the unquote-spicing operator (~@). Examples:

      (->vector 1 2 3 4 5 6 7 8 9)              =>  [1 2 3 4 5 6 7 8 9]
      (->vector 1 2 3 (unwrap [4 5 6]) 7 8 9)   =>  [1 2 3 4 5 6 7 8 9] 
sourceraw docstring

Unwrappedclj/s

source

val=clj/s≠

clj
(val= & vals)
cljs
(val= & rest113231)

Inputs: [& vals] Returns: s/Bool

Compares values for equality using clojure.core/=, treating records as plain map values:

  (defrecord SampleRec [a b])
  (assert (val= (->SampleRec 1 2) {:a 1 :b 2}))   ; fails for clojure.core/= 
Inputs: [& vals]
Returns: s/Bool

Compares values for equality using clojure.core/=, treating records as plain map values:

      (defrecord SampleRec [a b])
      (assert (val= (->SampleRec 1 2) {:a 1 :b 2}))   ; fails for clojure.core/= 
sourceraw docstring

validateclj/s

(validate tst-fn tst-val)

(validate tst-fn tst-val) Used to validate intermediate results. Returns tst-val if the result of (tst-fn tst-val) is truthy. Otherwise, throws ex-info with ex-data {:sample-val sample-val :tst-result tst-result}.

(validate tst-fn tst-val)
Used to validate intermediate results. Returns tst-val if the result of
(tst-fn tst-val) is truthy.  Otherwise, throws ex-info with ex-data
{:sample-val sample-val :tst-result tst-result}.
sourceraw docstring

validate-map-keysclj/s

(validate-map-keys tst-map valid-keys)

Inputs: [tst-map :- tsk/Map valid-keys :- MapKeySpec] Returns: s/Any

Inputs: [tst-map :- tsk/Map valid-keys :- MapKeySpec]
Returns: s/Any
sourceraw docstring

validate-or-defaultclj/s

(validate-or-default is-valid? sample-val default-val)

Returns sample-val if (is-valid? sample-val) is truthy; else returns default-val

Returns `sample-val` if `(is-valid? sample-val)` is truthy; else returns `default-val`
sourceraw docstring

vals->mapclj/smacro

(vals->map & symbols)

Called with a list of symbols like (vals->map a b c) returns a map like {:a a :b b :c c}.

(let [a 1
      b 2
      c 3]
  (vals->map a b c))  ;=>  {:a 1 :b 2 :c 3} }

See with-map-vals for simple destructuring of such maps.

Called with a list of symbols like `(vals->map a b c)` returns a map
like {:a a :b b :c c}.

    (let [a 1
          b 2
          c 3]
      (vals->map a b c))  ;=>  {:a 1 :b 2 :c 3} }

See `with-map-vals` for simple destructuring of such maps.
sourceraw docstring

verifyclj/smacro

(verify form)

(verify <some-expr>) Used to verify intermediate results. Returns value of <some-expr> if the result is truthy. Otherwise, throws an Exception.

(verify <some-expr>)
Used to verify intermediate results. Returns value of <some-expr> if the result
is truthy.  Otherwise, throws an Exception.
sourceraw docstring

walk-maps->sortedclj/s

(walk-maps->sorted form)

Recursively walks form, converting all maps to sorted-maps.

Recursively walks form, converting all maps to sorted-maps. 
sourceraw docstring

walk-with-parentsclj/s

(walk-with-parents data interceptor)

Inputs: [data :- s/Any interceptor :- tsk/KeyMap] Returns: s/Any

Performs a depth-first traversal of a data structure, using an interceptor with signature:

{:enter (fn [parents data] ...)
 :leave (fn [parents data] ...) }

For each data node in the tree, the :enter function is called prior to walking the subtree rooted at that element, and the :leave function is called after walking the subtree. The result of each function replaces the data value.

The parents arg to each interceptor function is a vector of elements from the root data value passed in. Using dummy (i.e. noop) interceptors which simply print their args as a map, we have this example:

Clojure maps & vectors/lists have special processing. They are broken up into a sequence of MapEntry/ListEntry elements, which are included in the :parents vector before walking the child data values. In this way, a map val can easily determine its correspond key or vice versa, and a vector/list/seq element can easily determine its index.

   (walk-with-parents  {:a 1 :b {:c 3}}}  <noop-intc>) =>

       :enter => {:parents [],                                                       :data {:a 1, :b {:c 3}}}
       :enter => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data :a}
       :leave => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data :a}
       :enter => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data 1}
       :leave => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data 1}
       :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data :b}
       :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data :b}
       :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data {:c 3}}
       :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data :c}
       :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data :c}
       :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data 3}
       :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data 3}
       :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data {:c 3}}
       :leave => {:parents [],                                                       :data {:a 1, :b {:c 3}}}

       NOTE: in above, items in the :parents like `[:a 1]` are #clojure.lang.MapEntry values.

   (walk-with-parents  [10 [20 21]]  <noop-intc>) =>

       :enter => {:parents [],
                  :data [10 [20 21]]}
       :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 0, :value 10}],
                  :data 10}
       :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 1, :value [20 21]}],
                  :data [20 21]}
       :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 1, :value [20 21]} [20 21] #t.c.ListEntry{:index 0, :value 20}],
                  :data 20}
       :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 1, :value [20 21]} [20 21] #t.c.ListEntry{:index 1, :value 21}],
                  :data 21}

 NOTE: in above, `#t.c.ListEntry` stands for `#tupelo.core.ListEntry`, an analog of #clojure.lang.MapEntry
Inputs: [data :- s/Any interceptor :- tsk/KeyMap]
Returns: s/Any

Performs a depth-first traversal of a data structure, using an interceptor with signature:

    {:enter (fn [parents data] ...)
     :leave (fn [parents data] ...) }

 For each data node in the tree, the `:enter` function is called prior to walking
 the subtree rooted at that element, and the `:leave` function is called after
 walking the subtree. The result of each function replaces the data value.

 The `parents` arg to each interceptor function is a vector of elements from the
 root data value passed in.  Using dummy (i.e. noop) interceptors which simply
 print their args as a map, we have this example:

 Clojure maps & vectors/lists have special processing.  They are broken up into a sequence of
 MapEntry/ListEntry elements, which are included in the :parents vector before walking the child
 data values. In this way, a map val can easily determine its correspond key or vice versa, and a
 vector/list/seq element can easily determine its index.

       (walk-with-parents  {:a 1 :b {:c 3}}}  <noop-intc>) =>

           :enter => {:parents [],                                                       :data {:a 1, :b {:c 3}}}
           :enter => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data :a}
           :leave => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data :a}
           :enter => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data 1}
           :leave => {:parents [{:a 1, :b {:c 3}} [:a 1]],                               :data 1}
           :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data :b}
           :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data :b}
           :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data {:c 3}}
           :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data :c}
           :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data :c}
           :enter => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data 3}
           :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}] {:c 3} [:c 3]],            :data 3}
           :leave => {:parents [{:a 1, :b {:c 3}} [:b {:c 3}]],                          :data {:c 3}}
           :leave => {:parents [],                                                       :data {:a 1, :b {:c 3}}}

           NOTE: in above, items in the :parents like `[:a 1]` are #clojure.lang.MapEntry values.

       (walk-with-parents  [10 [20 21]]  <noop-intc>) =>

           :enter => {:parents [],
                      :data [10 [20 21]]}
           :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 0, :value 10}],
                      :data 10}
           :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 1, :value [20 21]}],
                      :data [20 21]}
           :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 1, :value [20 21]} [20 21] #t.c.ListEntry{:index 0, :value 20}],
                      :data 20}
           :enter => {:parents [[10 [20 21]] #t.c.ListEntry{:index 1, :value [20 21]} [20 21] #t.c.ListEntry{:index 1, :value 21}],
                      :data 21}

     NOTE: in above, `#t.c.ListEntry` stands for `#tupelo.core.ListEntry`, an analog of #clojure.lang.MapEntry
sourceraw docstring

walk-with-parents-readonlyclj/s

(walk-with-parents-readonly data intc)

Inputs: [data :- s/Any intc :- tsk/KeyMap] Returns: s/Any

Walks a data structure as with walk-with-parents, but in a read-only mode (interceptor function return values are ignored). Use for side-effects such as printing or validation (throw Exception to indicate validation failure). Returns input value (can be used for chaining).

Inputs: [data :- s/Any intc :- tsk/KeyMap]
Returns: s/Any

Walks a data structure as with `walk-with-parents`, but in a read-only mode
(interceptor function return values are ignored). Use for side-effects
such as printing or validation (throw Exception to indicate validation failure).
Returns input value (can be used for chaining). 
sourceraw docstring

when-clojure-1-10-plusclj/smacro

(when-clojure-1-10-plus & forms)

Wraps code that should only be included for Clojure 1.10 or higher. Otherwise, code is supressed.

Wraps code that should only be included for Clojure 1.10 or higher.  Otherwise, code is supressed.
sourceraw docstring

when-clojure-1-8-plusclj/smacro

(when-clojure-1-8-plus & forms)

Wraps code that should only be included for Clojure 1.8 or higher. Otherwise, code is supressed.

Wraps code that should only be included for Clojure 1.8 or higher.  Otherwise, code is supressed.
sourceraw docstring

when-clojure-1-9-plusclj/smacro

(when-clojure-1-9-plus & forms)

Wraps code that should only be included for Clojure 1.9 or higher. Otherwise, code is supressed.

Wraps code that should only be included for Clojure 1.9 or higher.  Otherwise, code is supressed.
sourceraw docstring

when-not-clojure-1-9-plusclj/smacro

(when-not-clojure-1-9-plus & forms)

Wraps code that should only be included for Clojure versions prior to 1.9. Otherwise, code is supressed.

Wraps code that should only be included for Clojure versions prior to 1.9.  Otherwise, code is supressed.
sourceraw docstring

wild-item?clj/s

(wild-item? item)

Inputs: [item :- s/Any] Returns: s/Bool

Returns true if any element in a nested collection is the wildcard :*

Inputs: [item :- s/Any]
Returns: s/Bool

Returns true if any element in a nested collection is the wildcard :*
sourceraw docstring

wild-match-root?clj/s

(wild-match-root? ctx-in)
source

wild-match?clj/smultimethod

Returns true if a pattern is matched by one or more values. The special keyword :* (colon-star) in the pattern serves as a wildcard value. Note that a wildcald can match either a primitive or a composite value: Classic usage:

(wild-match? pattern & values)

examples:

(wild-match? {:a :* :b 2}
             {:a 1  :b 2})         ;=> true

(wild-match? [1 :* 3]
             [1 2  3]
             [1 9  3] ))           ;=> true

(wild-match? {:a :*       :b 2}
             {:a [1 2 3]  :b 2})   ;=> true

wild-match? also accepts a context map; usage:

(wild-match? ctx)

example (default values shown):

(wild-match?  { :submap-ok   false
                :subset-ok   false
                :subvec-ok   false
                :wildcard-ok true
                :pattern     <required param>
                :values    [ <patttern-spec>+ ]   ; vector of 1 or more required
              } )
Returns true if a pattern is matched by one or more values.  The special keyword :* (colon-star)
in the pattern serves as a wildcard value.  Note that a wildcald can match either a primitive or a
composite value: Classic usage:

    (wild-match? pattern & values)

examples:

    (wild-match? {:a :* :b 2}
                 {:a 1  :b 2})         ;=> true

    (wild-match? [1 :* 3]
                 [1 2  3]
                 [1 9  3] ))           ;=> true

    (wild-match? {:a :*       :b 2}
                 {:a [1 2 3]  :b 2})   ;=> true

wild-match? also accepts a context map; usage:

    (wild-match? ctx)

example (default values shown):

    (wild-match?  { :submap-ok   false
                    :subset-ok   false
                    :subvec-ok   false
                    :wildcard-ok true
                    :pattern     <required param>
                    :values    [ <patttern-spec>+ ]   ; vector of 1 or more required
                  } )
sourceraw docstring

wild-submatch?clj/s

(wild-submatch? pattern & values)

Simple wrapper for wild-match? where all types of sub-matching are enabled.

Simple wrapper for wild-match? where all types of sub-matching are enabled.
sourceraw docstring

with-cum-valclj/smacro

(with-cum-val init-val & forms)

Wraps forms containing cum-val-set-it calls to accumulate values into a vector.

Wraps forms containing `cum-val-set-it` calls to accumulate values into a vector.
sourceraw docstring

with-cum-vectorclj/smacro

(with-cum-vector & forms)

Wraps forms containing cum-vector-append calls to accumulate values into a vector.

Wraps forms containing `cum-vector-append` calls to accumulate values into a vector.
sourceraw docstring

with-debug-tagclj/smacro

(with-debug-tag debug-tag & forms)
source

with-err-strclj/smacro

(with-err-str & body)

Evaluates exprs in a context in which err is bound to a fresh StringWriter. Returns the string created by any nested printing calls.

Evaluates exprs in a context in which *err* is bound to a fresh
StringWriter.  Returns the string created by any nested printing
calls.
sourceraw docstring

with-exception-defaultclj/smacro

(with-exception-default default-val & forms)

Evaluates body & returns its result. In the event of an exception, default-val is returned instead of the exception.

Evaluates body & returns its result.  In the event of an exception, default-val is returned
instead of the exception.
sourceraw docstring

with-map-valsclj/smacro

(with-map-vals the-map items-vec & forms)

Given a map like {:a 1 :b 2 :c 3} (such as generated by (vals->map a b c)), performs safe let destructuring using grab like:

 (let [some-map  {:a 1 :b 2 :c 3} } ]
   (with-map-vals some-map [a b c]
      (+ a b c)))  ;=>  6

with-map-vals is safe for typos since grab will throw if the requested key is not present in the map. See vals->map for simple creation of labelled data maps.

Given a map like {:a 1 :b 2 :c 3} (such as generated by `(vals->map a b c)`),
performs safe `let` destructuring using `grab` like:

     (let [some-map  {:a 1 :b 2 :c 3} } ]
       (with-map-vals some-map [a b c]
          (+ a b c)))  ;=>  6

`with-map-vals` is safe for typos since `grab` will throw if the requested key is not present in the map.
See `vals->map` for simple creation of labelled data maps.
sourceraw docstring

with-nil-defaultclj/s

(with-nil-default default-val sample-val)

Returns sample-val if not nil; else returns default-val

Returns `sample-val` if not nil; else returns `default-val`
sourceraw docstring

with-resultclj/smacro

(with-result result & forms)

Evaluates result and returns it; also evaluates forms for their side-effects.

Evaluates `result` and returns it; also evaluates `forms` for their side-effects.
sourceraw docstring

with-spy-enabledclj/smacro

(with-spy-enabled tag & forms)
source

with-spy-indentclj/smacro

(with-spy-indent & forms)

Increments indentation level of all spy, spyx, or spyxx expressions within the body.

Increments indentation level of all spy, spyx, or spyxx expressions within the body.
sourceraw docstring

with-system-err-strclj/smacro

(with-system-err-str & body)

Evaluates exprs in a context in which JVM System/err is bound to a fresh PrintStream. Returns the string created by any nested printing calls.

Evaluates exprs in a context in which JVM System/err is bound to a fresh
PrintStream.  Returns the string created by any nested printing calls.
sourceraw docstring

with-system-out-strclj/smacro

(with-system-out-str & body)

Evaluates exprs in a context in which JVM System/out is bound to a fresh PrintStream. Returns the string created by any nested printing calls.

Evaluates exprs in a context in which JVM System/out is bound to a fresh
PrintStream.  Returns the string created by any nested printing calls.
sourceraw docstring

with-timerclj/smacro

(with-timer id & forms)

Prints id and the elapsed (elapsed) execution time for a set of forms.

Prints `id` and the elapsed (elapsed) execution time for a set of forms.
sourceraw docstring

with-timer-xclj/smacro

(with-timer-x form)

Prints the form and its (elapsed) execution time.

Prints the form and its (elapsed) execution time.
sourceraw docstring

xbutlastclj/s

(xbutlast coll)

Inputs: [coll :- [s/Any]] Returns: s/Any

Returns a vector of all but the last value in a list or vector. Throws if empty.

Inputs: [coll :- [s/Any]]
Returns: s/Any

Returns a vector of all but the last value in a list or vector. Throws if empty.
sourceraw docstring

xdropclj/s

(xdrop n coll)

Inputs: [n :- s/Num coll :- tsk/Collection] Returns: tsk/Collection

Returns a collection as a vector with the first n values removed. Returns map for map colls. Throws if empty.

Inputs: [n :- s/Num coll :- tsk/Collection]
Returns: tsk/Collection

Returns a collection as a vector with the first n values removed.    Returns map for map colls.
Throws if empty.
sourceraw docstring

xfirstclj/s

(xfirst coll)

Returns the first value in a list or vector. Throws if empty.

Returns the first value in a list or vector. Throws if empty.
sourceraw docstring

xfourthclj/s

(xfourth coll)

Returns the fourth value in a list or vector. Throws if (< len 4).

Returns the fourth value in a list or vector. Throws if (< len 4).
sourceraw docstring

xlastclj/s

(xlast coll)

Inputs: [coll :- [s/Any]] Returns: s/Any

Returns the last value in a list or vector. Throws if empty.

Inputs: [coll :- [s/Any]]
Returns: s/Any

Returns the last value in a list or vector. Throws if empty.
sourceraw docstring

xmapclj/s≠

clj
(xmap map-fn & colls)
cljs
(xmap G__112959 & rest112960)

Inputs: [map-fn & colls] Returns: tsk/Vec

Like clojure.core/mapv, but throws if colls are not of equal length.

Inputs: [map-fn & colls]
Returns: tsk/Vec

Like clojure.core/mapv, but throws if colls are not of equal length.
sourceraw docstring

xrestclj/s

(xrest coll)

Returns the last value in a list or vector. Throws if empty.

Returns the last value in a list or vector. Throws if empty.
sourceraw docstring

xreverseclj/s

(xreverse coll)

Returns a vector containing a sequence in reversed order. Throws if nil.

Returns a vector containing a sequence in reversed order. Throws if nil.
sourceraw docstring

xsecondclj/s

(xsecond coll)

Returns the second value in a list or vector. Throws if (< len 2).

Returns the second value in a list or vector. Throws if (< len 2).
sourceraw docstring

xtakeclj/s

(xtake n coll)

Returns the first n values from a collection. Returns map for map colls. Throws if empty.

Returns the first n values from a collection.  Returns map for map colls.
Throws if empty.
sourceraw docstring

xthirdclj/s

(xthird coll)

Returns the third value in a list or vector. Throws if (< len 3).

Returns the third value in a list or vector. Throws if (< len 3).
sourceraw docstring

xvecclj/s

(xvec coll)

Inputs: [coll :- [s/Any]] Returns: [s/Any]

Converts a collection into a vector. Throws if given nil.

Inputs: [coll :- [s/Any]]
Returns: [s/Any]

Converts a collection into a vector. Throws if given nil.
sourceraw docstring

yieldclj/smacro

(yield value)

Within a 'generator function' created by lazy-gen, populates the result lazy seq with the supplied value (a la Python). Returns the value.

Within a 'generator function' created by `lazy-gen`, populates the
result lazy seq with the supplied value (a la Python). Returns the value.
sourceraw docstring

yield-allclj/smacro

(yield-all values)

Within a 'generator function' created by lazy-gen, populates the result lazy seq with each item from the supplied collection. Returns the collection.

Within a 'generator function' created by `lazy-gen`, populates the
result lazy seq with each item from the supplied collection. Returns the collection.
sourceraw docstring

zipclj/s

(zip & args)

Zips together vectors producing a vector of tuples (like Python zip). Not lazy. Example:

(zip [:a :b :c] [1 2 3]) -> [ [:a 1] [:b 2] [:c 3] ]

***** WARNING - will hang for infinite length inputs *****

Zips together vectors producing a vector of tuples (like Python zip). Not lazy.
Example:

   (zip [:a :b :c] [1 2 3]) ->  [ [:a 1] [:b 2] [:c 3] ]

 ***** WARNING - will hang for infinite length inputs ***** 
sourceraw docstring

zip*clj/s

(zip* context & colls)

Usage: (zip* context & colls) where context is a map with default values: {:strict true} Not lazy.

Usage:  (zip* context & colls)
where context is a map with default values:  {:strict true}
Not lazy. 
sourceraw docstring

zip-1*clj/s

(zip-1* context & colls)

Usage: (zip* context & colls) where context is a map with default values: {:strict true} Not lazy.

Usage:  (zip* context & colls)
where context is a map with default values:  {:strict true}
Not lazy. 
sourceraw docstring

zip-lazyclj/s

(zip-lazy & colls)

Usage: (zip-lazy coll1 coll2 ...)

(zip-lazy xs ys zs) => [ [x0 y0 z0]
                         [x1 y1 z1]
                         [x2 y2 z2]
                         ... ]

Returns a lazy result. Will truncate to the length of the shortest collection. A convenience wrapper for (map vector coll1 coll2 ...).

Usage:  (zip-lazy coll1 coll2 ...)

    (zip-lazy xs ys zs) => [ [x0 y0 z0]
                             [x1 y1 z1]
                             [x2 y2 z2]
                             ... ]

Returns a lazy result. Will truncate to the length of the shortest collection.
A convenience wrapper for `(map vector coll1 coll2 ...)`.  
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close