Namespace: joker.core
v1.0Contents
Summary
Core library of Joker.
Index
- *
- *'
- *1
- *2
- *3
- *assert*
- *command-line-args*
- *e
- *err*
- *file*
- *flush-on-newline*
- *in*
- *joker-version*
- *linter-config*
- *linter-mode*
- *main-file*
- *ns*
- *out*
- *print-readably*
- +
- +'
- -
- -'
- ->
- ->>
- ..
- /
- <
- <!
- <=
- =
- ==
- >
- >!
- >=
- GoTypeOf
- TypeOfAsString
- alias
- all-ns
- alter-meta!
- and
- any?
- apply
- array-map
- as->
- assert
- assoc
- assoc-in
- associative?
- atom
- bigfloat
- bigfloat?
- bigint
- binding
- bit-and
- bit-and-not
- bit-clear
- bit-flip
- bit-not
- bit-or
- bit-set
- bit-shift-left
- bit-shift-right
- bit-test
- bit-xor
- boolean
- boolean?
- bound?
- bounded-count
- butlast
- callable?
- case
- cast
- chan
- char
- char?
- chunked-seq?
- class
- close!
- coll?
- comment
- comp
- compare
- complement
- concat
- cond
- cond->
- cond->>
- condp
- conj
- cons
- constantly
- contains?
- count
- counted?
- create-ns
- cycle
- dec
- dec'
- declare
- dedupe
- default-data-readers
- defmacro
- defmethod
- defmulti
- defn
- defn-
- defonce
- deftype
- delay
- delay?
- denominator
- deref
- disj
- dissoc
- distinct
- distinct?
- doall
- dorun
- doseq
- dotimes
- doto
- double
- double?
- drop
- drop-last
- drop-while
- empty
- empty?
- eval
- even?
- every-pred
- every?
- ex-cause
- ex-data
- ex-info
- ex-message
- exit
- false?
- ffirst
- filter
- filterv
- find
- find-ns
- find-var
- first
- flatten
- float?
- flush
- fn
- fn?
- fnext
- fnil
- for
- force
- format
- frequencies
- gensym
- get
- get-in
- get-method
- go
- goobject?
- group-by
- hash
- hash-map
- hash-set
- ident?
- identical?
- identity
- if-let
- if-not
- if-some
- in-ns
- inc
- inc'
- indexed?
- instance?
- int
- int?
- integer?
- interleave
- intern
- interpose
- into
- iterate
- joker-version
- juxt
- keep
- keep-indexed
- key
- keys
- keyword
- keyword?
- last
- lazy-cat
- lazy-seq
- let
- letfn
- line-seq
- list
- list*
- list?
- load
- load-file
- load-string
- loaded-libs
- loop
- macroexpand
- macroexpand-1
- map
- map-indexed
- map?
- mapcat
- mapv
- max
- max-key
- memoize
- merge
- merge-with
- meta
- methods
- min
- min-key
- mod
- name
- namespace
- nat-int?
- neg-int?
- neg?
- new
- newline
- next
- nfirst
- nil?
- nnext
- not
- not-any?
- not-empty
- not-every?
- not=
- ns
- ns-aliases
- ns-interns
- ns-map
- ns-name
- ns-publics
- ns-refers
- ns-resolve
- ns-sources
- ns-unalias
- ns-unmap
- nth
- nthnext
- nthrest
- num
- number?
- numerator
- odd?
- or
- partial
- partition
- partition-all
- partition-by
- peek
- pop
- pos-int?
- pos?
- pprint
- pr
- pr-err
- pr-str
- prefer-method
- prefers
- print-err
- print-str
- printf
- println
- println-err
- println-str
- prn
- prn-err
- prn-str
- qualified-ident?
- qualified-keyword?
- qualified-symbol?
- quot
- rand
- rand-int
- rand-nth
- random-sample
- range
- ratio?
- rational?
- re-find
- re-matches
- re-pattern
- re-seq
- read
- read-line
- read-string
- realized?
- reduce
- reduce-kv
- reductions
- refer
- refer-clojure
- rem
- remove
- remove-all-methods
- remove-method
- remove-ns
- repeat
- repeatedly
- replace
- require
- requiring-resolve
- reset!
- reset-meta!
- reset-vals!
- resolve
- rest
- reverse
- reversible?
- rseq
- run!
- second
- select-keys
- seq
- seq?
- seqable?
- sequence
- sequential?
- set
- set?
- shuffle
- simple-ident?
- simple-keyword?
- simple-symbol?
- slurp
- some
- some->
- some->>
- some-fn
- some?
- sort
- sort-by
- special-symbol?
- spit
- split-at
- split-with
- str
- string?
- subs
- subvec
- swap!
- swap-vals!
- symbol
- symbol?
- take
- take-last
- take-nth
- take-while
- test
- the-ns
- time
- trampoline
- tree-seq
- true?
- type
- unsigned-bit-shift-right
- update
- update-in
- update-keys
- update-vals
- use
- val
- vals
- var-get
- var-set
- var?
- vary-meta
- vec
- vector
- vector?
- when
- when-first
- when-let
- when-not
- when-some
- while
- with-bindings
- with-bindings*
- with-in-str
- with-meta
- with-out-str
- with-redefs
- with-redefs-fn
- xml-seq
- zero?
- zipmap
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
*1
String v1.0bound in a repl to the most recent value printed
source -
*2
String v1.0bound in a repl to the second most recent value printed
source -
*3
String v1.0bound in a repl to the third most recent value printed
source -
*assert*
Boolean v1.0When set to logical false, assert is a noop. Defaults to true.
-
*command-line-args*
Seq v1.0A sequence of the supplied command line arguments, or nil if
none were supplied -
*e
String v1.0bound in a repl to the most recent exception caught by the repl
source -
*err*
IOWriter v1.0A IOWriter object representing standard error for print operations.
Defaults to stderr. -
*file*
String v1.0The path of the file being evaluated, as a String.
When there is no file, e.g. in the REPL, the value is not defined. -
*flush-on-newline*
Boolean v1.0When set to true, output will be flushed whenever a newline is printed.
source
Defaults to true. -
*in*
BufferedReader v1.0A BufferedReader object representing standard input for read operations.
Defaults to stdin. -
*joker-version*
ArrayMap v1.0The version info for Clojure core, as a map containing :major :minor
:incremental and :qualifier keys. Feature releases may increment
:minor and/or :major, bugfix releases will increment :incremental. -
*linter-config*
ArrayMap v1.0Map of configuration key/value pairs for linter mode
-
*linter-mode*
Boolean v1.0true if Joker is running in linter mode
-
*main-file*
String v1.0The absolute path of <filename> on the command line, as a String.
When there is no file, e.g. in the REPL, the value is not defined. -
*ns*
Namespace v1.0A Namespace object representing the current namespace.
-
*out*
IOWriter v1.0A IOWriter object representing standard output for print operations.
Defaults to stdout. -
*print-readably*
Boolean v1.0When set to logical false, strings and characters will be printed with
non-alphanumeric characters converted to the appropriate escape sequences.
Defaults to true -
default-data-readers
ArrayMap v1.0Default map of data reader functions provided by Joker. May be
source
overridden by binding *data-readers*.
Functions, Macros, and Special Forms
-
*
Function v1.0(*)
^Number (*)
(* x)
^Number (* ^Number x)
(* x y)
^Number (* ^Number x ^Number y)
(* x y & more)
^Number (* ^Number x ^Number y & more)
Returns the product of nums. (*) returns 1. Does not auto-promote
source show types
ints, will overflow. See also: *' -
*'
Function v1.0(*')
^Number (*')
(*' x)
^Number (*' ^Number x)
(*' x y)
^Number (*' ^Number x ^Number y)
(*' x y & more)
^Number (*' ^Number x ^Number y & more)
Returns the product of nums. (*) returns 1. Supports arbitrary precision.
source show types
See also: * -
+
Function v1.0(+)
^Number (+)
(+ x)
^Number (+ ^Number x)
(+ x y)
^Number (+ ^Number x ^Number y)
(+ x y & more)
^Number (+ ^Number x ^Number y & more)
Returns the sum of nums. (+) returns 0. Does not auto-promote
source show types
ints, will overflow. See also: +' -
+'
Function v1.0(+')
^Number (+')
(+' x)
^Number (+' ^Number x)
(+' x y)
^Number (+' ^Number x ^Number y)
(+' x y & more)
^Number (+' ^Number x ^Number y & more)
Returns the sum of nums. (+) returns 0. Supports arbitrary precision.
source show types
See also: + -
-
Function v1.0(- x)
^Number (- ^Number x)
(- x y)
^Number (- ^Number x ^Number y)
(- x y & more)
^Number (- ^Number x ^Number y & more)
If no ys are supplied, returns the negation of x, else subtracts
source show types
the ys from x and returns the result. Does not auto-promote
ints, will overflow. See also: -' -
-'
Function v1.0(-' x)
^Number (-' ^Number x)
(-' x y)
^Number (-' ^Number x ^Number y)
(-' x y & more)
^Number (-' ^Number x ^Number y & more)
If no ys are supplied, returns the negation of x, else subtracts
source show types
the ys from x and returns the result. Supports arbitrary precision.
See also: - -
->
Macro v1.0(-> x & forms)
Threads the expr through the forms. Inserts x as the
source
second item in the first form, making a list of it if it is not a
list already. If there are more forms, inserts the first form as the
second item in second form, etc. -
->>
Macro v1.0(->> x & forms)
Threads the expr through the forms. Inserts x as the
source
last item in the first form, making a list of it if it is not a
list already. If there are more forms, inserts the first form as the
last item in second form, etc. -
..
Macro v1.0(.. x form)
(.. x form & more)
form => fieldName-symbol or (instanceMethodName-symbol args*)
source
Expands into a member access (.) of the first member on the first
argument, followed by the next member on the result, etc. For
instance:
(.. System (getProperties) (get "os.name"))
expands to:
(. (. System (getProperties)) (get "os.name"))
but is easier to write, read, and understand. -
/
Function v1.0(/ x)
^Number (/ ^Number x)
(/ x y)
^Number (/ ^Number x ^Number y)
(/ x y & more)
^Number (/ ^Number x ^Number y & more)
If no denominators are supplied, returns 1/numerator,
source show types
else returns numerator divided by all of the denominators. -
<
Function v1.0(< x)
^Boolean (< ^Number x)
(< x y)
^Boolean (< ^Number x ^Number y)
(< x y & more)
^Boolean (< ^Number x ^Number y & more)
Returns non-nil if nums are in monotonically increasing order,
source show types
otherwise false. -
<!
Function v1.0(<! ch)
(<! ^Channel ch)
Takes a value from ch.
source show types
Returns nil if ch is closed and nothing is available on ch.
Blocks if nothing is available on ch and ch is not closed. -
<=
Function v1.0(<= x)
^Boolean (<= ^Number x)
(<= x y)
^Boolean (<= ^Number x ^Number y)
(<= x y & more)
^Boolean (<= ^Number x ^Number y & more)
Returns non-nil if nums are in monotonically non-decreasing order,
source show types
otherwise false. -
=
Function v1.0(= x)
^Boolean (= x)
(= x y)
^Boolean (= x y)
(= x y & more)
^Boolean (= x y & more)
Equality. Returns true if x equals y, false if not. Works for nil, and compares
source show types
numbers and collections in a type-independent manner. Immutable data
structures define = as a value, not an identity,
comparison. -
==
Function v1.0(== x)
^Boolean (== ^Number x)
(== x y)
^Boolean (== ^Number x ^Number y)
(== x y & more)
^Boolean (== ^Number x ^Number y & more)
Returns non-nil if nums all have the equivalent
source show types
value (type-independent), otherwise false -
>
Function v1.0(> x)
^Boolean (> ^Number x)
(> x y)
^Boolean (> ^Number x ^Number y)
(> x y & more)
^Boolean (> ^Number x ^Number y & more)
Returns non-nil if nums are in monotonically decreasing order,
source show types
otherwise false. -
>!
Function v1.0(>! ch val)
(>! ^Channel ch val)
Puts val into ch.
source show types
Throws an exception if val is nil.
Blocks if ch is full (no buffer space is available).
Returns true unless ch is already closed. -
>=
Function v1.0(>= x)
^Boolean (>= ^Number x)
(>= x y)
^Boolean (>= ^Number x ^Number y)
(>= x y & more)
^Boolean (>= ^Number x ^Number y & more)
Returns non-nil if nums are in monotonically non-increasing order,
source show types
otherwise false. -
GoTypeOf
Function v1.0(GoTypeOf t)
(GoTypeOf ^GoObject t)
Returns the Type of a GoObject. Panics if it's not a Type.
source show types -
TypeOfAsString
Function v1.0(TypeOfAsString t)
Returns the full Joker type name of any object as a docstring.
source -
alias
Function v1.0(alias alias namespace-sym)
^Nil (alias ^Symbol alias namespace-sym)
Add an alias in the current namespace to another
source show types
namespace. Arguments are two symbols: the alias to be used, and
the symbolic name of the target namespace. Use :as in the ns macro in preference
to calling this directly. -
all-ns
Function v1.0(all-ns)
^Seq (all-ns)
Returns a sequence of all namespaces.
source show types -
alter-meta!
Function v1.0(alter-meta! ref f & args)
(alter-meta! ^Ref ref ^Callable f & args)
Atomically sets the metadata for a namespace/var/atom to be:
source show types
(apply f its-current-meta args)
f must be free of side-effects -
and
Macro v1.0(and)
(and x)
(and x & next)
Evaluates exprs one at a time, from left to right. If a form
source
returns logical false (nil or false), and returns that value and
doesn't evaluate any of the other expressions, otherwise it returns
the value of the last expr. (and) returns true. -
any?
Function v1.0(any? x)
Returns true given any argument.
source -
apply
Function v1.0(apply f args)
(apply ^Callable f ^Seqable args)
(apply f x args)
(apply ^Callable f x ^Seqable args)
(apply f x y args)
(apply ^Callable f x y ^Seqable args)
(apply f x y z args)
(apply ^Callable f x y z ^Seqable args)
(apply f a b c d & args)
(apply ^Callable f a b c d & args)
Applies fn f to the argument list formed by prepending intervening arguments to args.
source show types -
array-map
Function v1.0(array-map & keyvals)
Constructs an array-map. If any keys are equal, they are handled as
source
if by repeated uses of assoc. -
as->
Macro v1.0(as-> expr name & forms)
Binds name to expr, evaluates the first form in the lexical context
source
of that binding, then binds name to that result, repeating for each
successive form, returning the result of the last form. -
assert
Macro v1.0(assert x)
(assert x message)
Evaluates expr and throws an exception if it does not evaluate to
source
logical true. -
assoc
Function v1.0(assoc map key val)
(assoc map key val & kvs)
`assoc[iate]. When applied to a map, returns a new map of the
source
same (hashed/sorted) type, that contains the mapping of key(s) to
val(s). When applied to a vector, returns a new vector that
contains val at index. Note - index must be <= (count vector). -
assoc-in
Function v1.0(assoc-in m ks v)
^Map (assoc-in ^Associative m ^Seqable ks v)
Associates a value in a nested associative structure, where ks is a
source show types
sequence of keys and v is the new value and returns a new nested structure.
If any levels do not exist, hash-maps will be created. -
associative?
Function v1.0(associative? coll)
^Boolean (associative? coll)
Returns true if coll implements Associative
source show types -
atom
Function v1.0(atom x & options)
^Atom (atom x & options)
Creates and returns an Atom with an initial value of x and zero or
source show types
more options (in any order):
:meta metadata-map
If metadata-map is supplied, it will become the metadata on the
atom. -
bigfloat
Function v1.0(bigfloat x)
^BigFloat (bigfloat x)
Coerce to BigFloat
source show types -
bigfloat?
Function v1.0(bigfloat? n)
^Boolean (bigfloat? n)
Returns true if n is a BigFloat
source show types -
bigint
Function v1.0(bigint x)
^BigInt (bigint x)
Coerce to BigInt
source show types -
binding
Macro v1.0(binding bindings & body)
binding => var-symbol init-expr
source
Creates new bindings for the (already-existing) vars, with the
supplied initial values, executes the exprs in an implicit do, then
re-establishes the bindings that existed before. The new bindings
are made in parallel (unlike let); all init-exprs are evaluated
before the vars are bound to their new values. -
bit-and
Function v1.0(bit-and x y)
^Int (bit-and ^Int x ^Int y)
(bit-and x y & more)
^Int (bit-and ^Int x ^Int y & more)
Bitwise and
source show types -
bit-and-not
Function v1.0(bit-and-not x y)
^Int (bit-and-not ^Int x ^Int y)
(bit-and-not x y & more)
^Int (bit-and-not ^Int x ^Int y & more)
Bitwise and with complement
source show types -
bit-clear
Function v1.0(bit-clear x n)
^Int (bit-clear ^Int x ^Int n)
Clear bit at index n
source show types -
bit-flip
Function v1.0(bit-flip x n)
^Int (bit-flip ^Int x ^Int n)
Flip bit at index n
source show types -
bit-not
Function v1.0(bit-not x)
^Int (bit-not ^Int x)
Bitwise complement
source show types -
bit-or
Function v1.0(bit-or x y)
^Int (bit-or ^Int x ^Int y)
(bit-or x y & more)
^Int (bit-or ^Int x ^Int y & more)
Bitwise or
source show types -
bit-set
Function v1.0(bit-set x n)
^Int (bit-set ^Int x ^Int n)
Set bit at index n
source show types -
bit-shift-left
Function v1.0(bit-shift-left x n)
^Int (bit-shift-left ^Int x ^Int n)
Bitwise shift left
source show types -
bit-shift-right
Function v1.0(bit-shift-right x n)
^Int (bit-shift-right ^Int x ^Int n)
Bitwise shift right
source show types -
bit-test
Function v1.0(bit-test x n)
^Boolean (bit-test ^Int x ^Int n)
Test bit at index n
source show types -
bit-xor
Function v1.0(bit-xor x y)
^Int (bit-xor ^Int x ^Int y)
(bit-xor x y & more)
^Int (bit-xor ^Int x ^Int y & more)
Bitwise exclusive or
source show types -
boolean
Function v1.0(boolean x)
^Boolean (boolean x)
Coerce to boolean
source show types -
boolean?
Function v1.0(boolean? x)
Return true if x is a Boolean
source -
bound?
Function v1.0(bound? & vars)
^Boolean (bound? & vars)
Returns true if all of the vars provided as arguments have any bound value.
source show types
Implies that deref'ing the provided vars will succeed. Returns true if no vars are provided. -
bounded-count
Function v1.0(bounded-count n coll)
^Int (bounded-count ^Number n coll)
If coll is counted? returns its count, else will count at most the first n
source show types
elements of coll using its seq -
butlast
Function v1.0(butlast coll)
Return a seq of all but the last item in coll, in linear time.
source -
callable?
Function v1.0(callable? x)
^Boolean (callable? x)
Returns true if x implements Callable. Note that many data structures
source show types
(e.g. sets and maps) implement Callable. -
case
Macro v1.0(case expr & clauses)
Takes an expression, and a set of clauses.
source
Each clause can take the form of either:
test-expr result-expr
(test-expr ... test-expr) result-expr
If the expression is equal to a value of
test-expr, the corresponding result-expr is returned. A single
default expression can follow the clauses, and its value will be
returned if no clause matches. If no default expression is provided
and no clause matches, an exception is thrown. -
cast
Function v1.0(cast t x)
(cast ^Type t x)
Throws an error if x is not of a type t, else returns x.
source show types -
chan
Function v1.0(chan)
^Channel (chan)
(chan n)
^Channel (chan ^Int n)
Returns a new channel with an optional buffer of size n.
source show types -
char
Function v1.0(char x)
^Char (char x)
Coerce to char
source show types -
char?
Function v1.0(char? x)
Returns true if x is a Char
source -
chunked-seq?
Function v1.0(chunked-seq? s)
^Boolean (chunked-seq? s)
Always returns false because chunked sequences are not supported
source show types -
class
Function v1.0(class x)
^Type (class x)
Returns the Type of x.
source show types -
close!
Function v1.0(close! ch)
(close! ^Channel ch)
Closes a channel. The channel will no longer accept any puts (they
source show types
will be ignored). Data in the channel remains available for taking, until
exhausted, after which takes will return nil. If there are any
pending takes, they will be dispatched with nil. Closing a closed
channel is a no-op. Returns nil.
Logically closing happens after all puts have been delivered. Therefore, any
blocked puts will remain blocked until a taker releases them. -
coll?
Function v1.0(coll? x)
^Boolean (coll? x)
Returns true if x implements Collection
source show types -
comment
Macro v1.0(comment & body)
Ignores body, yields nil
source -
comp
Function v1.0(comp)
^Fn (comp)
(comp f)
^Fn (comp ^Callable f)
(comp f g)
^Fn (comp ^Callable f ^Callable g)
(comp f g h)
^Fn (comp ^Callable f ^Callable g ^Callable h)
(comp f1 f2 f3 & fs)
^Fn (comp ^Callable f1 ^Callable f2 ^Callable f3 & fs)
Takes a set of functions and returns a fn that is the composition
source show types
of those fns. The returned fn takes a variable number of args,
applies the rightmost of fns to the args, the next
fn (right-to-left) to the result, etc. -
compare
Function v1.0(compare x y)
^Int (compare x y)
Comparator. Returns a negative number, zero, or a positive number
source show types
when x is logically 'less than', 'equal to', or 'greater than'
y. Works for nil, and compares numbers and collections in a type-independent manner. x
must implement Comparable -
complement
Function v1.0(complement f)
^Fn (complement ^Callable f)
Takes a fn f and returns a fn that takes the same arguments as f,
source show types
has the same effects, if any, and returns the opposite truth value. -
concat
Function v1.0(concat)
^Seq (concat)
(concat x)
^Seq (concat ^Seqable x)
(concat x y)
^Seq (concat ^Seqable x ^Seqable y)
(concat x y & zs)
^Seq (concat ^Seqable x ^Seqable y & zs)
Returns a lazy seq representing the concatenation of the elements in the supplied colls.
source show types -
cond
Macro v1.0(cond & clauses)
Takes a set of test/expr pairs. It evaluates each test one at a
source
time. If a test returns logical true, cond evaluates and returns
the value of the corresponding expr and doesn't evaluate any of the
other tests or exprs. (cond) returns nil. -
cond->
Macro v1.0(cond-> expr & clauses)
Takes an expression and a set of test/form pairs. Threads expr (via ->)
source
through each form for which the corresponding test
expression is true. Note that, unlike cond branching, cond-> threading does
not short circuit after the first true test expression. -
cond->>
Macro v1.0(cond->> expr & clauses)
Takes an expression and a set of test/form pairs. Threads expr (via ->>)
source
through each form for which the corresponding test expression
is true. Note that, unlike cond branching, cond->> threading does not short circuit
after the first true test expression. -
condp
Macro v1.0(condp pred expr & clauses)
Takes a binary predicate, an expression, and a set of clauses.
source
Each clause can take the form of either:
test-expr result-expr
test-expr :>> result-fn
Note :>> is an ordinary keyword.
For each clause, (pred test-expr expr) is evaluated. If it returns
logical true, the clause is a match. If a binary clause matches, the
result-expr is returned, if a ternary clause matches, its result-fn,
which must be a unary function, is called with the result of the
predicate as its argument, the result of that call being the return
value of condp. A single default expression can follow the clauses,
and its value will be returned if no clause matches. If no default
expression is provided and no clause matches, an
exception is thrown. -
conj
Function v1.0(conj coll x)
(conj coll x & xs)
conj[oin]. Returns a new collection with the xs
source
'added'. (conj nil item) returns (item). The 'addition' may
happen at different 'places' depending on the concrete type. -
cons
Function v1.0(cons x seq)
Returns a new seq where x is the first element and seq is
source
the rest. -
constantly
Function v1.0(constantly x)
^Fn (constantly x)
Returns a function that takes any number of arguments and returns x.
source show types -
contains?
Function v1.0(contains? coll key)
^Boolean (contains? ^Gettable coll key)
Returns true if key is present in the given collection, otherwise
source show types
returns false. Note that for numerically indexed collections like
vectors, this tests if the numeric key is within the
range of indexes. 'contains?' operates constant or logarithmic time;
it will not perform a linear search for a value. See also 'some'. -
count
Function v1.0(count coll)
^Int (count coll)
Returns the number of items in the collection. (count nil) returns
source show types
0. Also works on strings -
counted?
Function v1.0(counted? coll)
^Boolean (counted? coll)
Returns true if coll implements count in constant time
source show types -
create-ns
Function v1.0(create-ns sym)
^Namespace (create-ns ^Symbol sym)
Create a new namespace named by the symbol if one doesn't already
source show types
exist, returns it or the already-existing namespace of the same
name. -
cycle
Function v1.0(cycle coll)
^Seq (cycle ^Seqable coll)
Returns a lazy (infinite!) sequence of repetitions of the items in coll.
source show types -
dec
Function v1.0(dec x)
^Number (dec ^Number x)
Returns a number one less than num. Does not auto-promote
source show types
ints, will overflow. See also: dec' -
dec'
Function v1.0(dec' x)
^Number (dec' ^Number x)
Returns a number one less than num. Supports arbitrary precision.
source show types
See also: dec -
declare
Macro v1.0(declare & names)
defs the supplied var names with no bindings, useful for making forward declarations.
source -
dedupe
Function v1.0(dedupe coll)
^Seq (dedupe ^Seqable coll)
Returns a lazy sequence removing consecutive duplicates in coll.
source show types -
defmacro
Macro v1.0(defmacro name doc-string? attr-map? [params*] body)
(defmacro name doc-string? attr-map? ([params*] body) + attr-map?)
Like defn, but the resulting function name is declared as a
source
macro and will be used as a macro by the compiler when it is
called. -
defmethod
Macro v1.0(defmethod multifn dispatch-val & fn-tail)
Creates and installs a new method of multimethod associated with dispatch-value.
source -
defmulti
Macro v1.0(defmulti name docstring? attr-map? dispatch-fn & options)
Creates a new multimethod with the associated dispatch function.
source
The docstring and attr-map are optional.
Options are key-value pairs and may be one of:
:default
The default dispatch value, defaults to :default
:hierarchy (UNSUPPORTED)
The value used for hierarchical dispatch (e.g. ::square is-a ::shape)
Hierarchies are type-like relationships that do not depend upon type
inheritance. By default Clojure's multimethods dispatch off of a
global hierarchy map. However, a hierarchy relationship can be
created with the derive function used to augment the root ancestor
created with make-hierarchy.
Multimethods expect the value of the hierarchy option to be supplied as
a reference type e.g. a var (i.e. via the Var-quote dispatch macro #'
or the var special form). -
defn
Macro v1.0(defn name doc-string? attr-map? [params*] prepost-map? body)
(defn name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?)
Same as (def name (fn [params* ] exprs*)) or (def
source
name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
to the var metadata. prepost-map defines a map with optional keys
:pre and :post that contain collections of pre or post conditions. -
defn-
Macro v1.0(defn- name & decls)
same as defn, yielding non-public def
source -
defonce
Macro v1.0(defonce name expr)
defs name to have the value of the expr if the named var is not bound,
source
else expr is unevaluated -
deftype
Macro v1.0(deftype name [& fields] & opts+specs)
(deftype name [fields*] options* specs*)
source
No fields, options, nor specs are currently supported; though this
defines a type at runtime, the resulting type is currently
useless. This macro is implemented for code-generation purposes in
the 'gostd' fork, which expects metadata defining the `:go` keyword
appropriately; so, defining a type without `:go` set in the metadata
is rejected at runtime. -
delay
Macro v1.0(delay & body)
Takes a body of expressions and yields a Delay object that will
source
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. See also - realized? -
delay?
Function v1.0(delay? x)
^Boolean (delay? x)
returns true if x is a Delay created with delay
source show types -
denominator
Function v1.0(denominator r)
^Number (denominator ^Ratio r)
Returns the denominator part of a Ratio.
source show types -
deref
Function v1.0(deref ref)
(deref ^Deref ref)
Also reader macro: @var/@atom/@delay. When applied to a var or atom,
source show types
returns its current state. When applied to a delay, forces it if not
already forced.
When applied to a GoObject, returns a Joker or GoObject with the
value itself (dereferenced if the input was already a GoObject). An
attempt to dereference a GoObject wrapping a non-pointer object
returns a builtin Joker object corresponding to that object, if
available; else a panic results.
Note that a dereferenced GoObject might not be fully supported due
to being private in the underlying Go package. For example, objects
created via go.std.errors/New are not directly supported by member
references. -
disj
Function v1.0(disj set)
^MapSet (disj ^Set set)
(disj set key)
^MapSet (disj ^Set set key)
(disj set key & ks)
^MapSet (disj ^Set set key & ks)
disj[oin]. Returns a new set of the same (hashed/sorted) type, that
source show types
does not contain key(s). -
dissoc
Function v1.0(dissoc map)
^Map (dissoc ^Map map)
(dissoc map key)
^Map (dissoc ^Map map key)
(dissoc map key & ks)
^Map (dissoc ^Map map key & ks)
dissoc[iate]. Returns a new map of the same (hashed/sorted) type,
source show types
that does not contain a mapping for key(s). -
distinct
Function v1.0(distinct coll)
^Seq (distinct ^Seqable coll)
Returns a lazy sequence of the elements of coll with duplicates removed.
source show types -
distinct?
Function v1.0(distinct? x)
^Boolean (distinct? x)
(distinct? x y)
^Boolean (distinct? x y)
(distinct? x y & more)
^Boolean (distinct? x y & more)
Returns true if no two of the arguments are =
source show types -
doall
Function v1.0(doall coll)
^Seq (doall ^Seqable coll)
(doall n coll)
^Seq (doall ^Number n ^Seqable coll)
When lazy sequences are produced via functions that have side
source show types
effects, any effects other than those needed to produce the first
element in the seq do not occur until the seq is consumed. doall can
be used to force any effects. Walks through the successive nexts of
the seq, retains the head and returns it, thus causing the entire
seq to reside in memory at one time. -
dorun
Function v1.0(dorun coll)
^Nil (dorun ^Seqable coll)
(dorun n coll)
^Nil (dorun ^Number n ^Seqable coll)
When lazy sequences are produced via functions that have side
source show types
effects, any effects other than those needed to produce the first
element in the seq do not occur until the seq is consumed. dorun can
be used to force any effects. Walks through the successive nexts of
the seq, does not retain the head and returns nil. -
doseq
Macro v1.0(doseq seq-exprs & body)
Repeatedly executes body (presumably for side-effects) with
source
bindings and filtering as provided by "for". Does not retain
the head of the sequence. Returns nil. -
dotimes
Macro v1.0(dotimes bindings & body)
bindings => name n
source
Repeatedly executes body (presumably for side-effects) with name
bound to integers from 0 through n-1. -
doto
Macro v1.0(doto x & forms)
Evaluates x then calls all of the methods and functions with the
source
value of x supplied at the front of the given arguments. The forms
are evaluated in order. Returns x. -
double
Function v1.0(double x)
^Double (double ^Number x)
Coerce to double
source show types -
double?
Function v1.0(double? x)
^Boolean (double? x)
Return true if x is a Double
source show types -
drop
Function v1.0(drop n coll)
^Seq (drop ^Number n ^Seqable coll)
Returns a lazy sequence of all but the first n items in coll.
source show types -
drop-last
Function v1.0(drop-last s)
^Seq (drop-last ^Seqable s)
(drop-last n s)
^Seq (drop-last ^Number n ^Seqable s)
Return a lazy sequence of all but the last n (default 1) items in coll
source show types -
drop-while
Function v1.0(drop-while pred coll)
^Seq (drop-while ^Callable pred ^Seqable coll)
Returns a lazy sequence of the items in coll starting from the first
source show types
item for which (pred item) returns logical false. -
empty
Function v1.0(empty coll)
^Collection (empty coll)
Returns an empty collection of the same category as coll, or nil
source show types -
empty?
Function v1.0(empty? coll)
^Boolean (empty? ^Seqable coll)
Returns true if coll has no items - same as (not (seq coll)).
source show types
Please use the idiom (seq x) rather than (not (empty? x)) -
eval
Function v1.0(eval form)
Evaluates the form data structure (not text!) and returns the result.
source -
even?
Function v1.0(even? n)
^Boolean (even? n)
Returns true if n is even, throws an exception if n is not an integer
source show types -
every-pred
Function v1.0(every-pred p)
^Fn (every-pred ^Callable p)
(every-pred p1 p2)
^Fn (every-pred ^Callable p1 ^Callable p2)
(every-pred p1 p2 p3)
^Fn (every-pred ^Callable p1 ^Callable p2 ^Callable p3)
(every-pred p1 p2 p3 & ps)
^Fn (every-pred ^Callable p1 ^Callable p2 ^Callable p3 & ps)
Takes a set of predicates and returns a function f that returns true if all of its
source show types
composing predicates return a logical true value against all of its arguments, else it returns
false. Note that f is short-circuiting in that it will stop execution on the first
argument that triggers a logical false result against the original predicates. -
every?
Function v1.0(every? pred coll)
^Boolean (every? ^Callable pred ^Seqable coll)
Returns true if (pred x) is logical true for every x in coll, else
source show types
false. -
ex-cause
Function v1.0(ex-cause ex)
^Error (ex-cause ex)
Returns the cause of ex if ex is an ExInfo.
source show types
Otherwise returns nil. -
ex-data
Function v1.0(ex-data ex)
^Map (ex-data ex)
Returns exception data (a map) if ex is an ExInfo.
source show types
Otherwise returns nil. -
ex-info
Function v1.0(ex-info msg map)
(ex-info msg map cause)
Create an instance of ExInfo, an Error that carries a map of additional data.
source -
ex-message
Function v1.0(ex-message ex)
^String (ex-message ex)
Returns the message attached to ex if ex is an ExInfo.
source show types
Otherwise returns nil. -
exit
Function v1.0(exit)
(exit code)
(exit ^Int code)
Causes the current program to exit with the given status code (defaults to 0).
source show types -
false?
Function v1.0(false? x)
Returns true if x is the value false, false otherwise.
source -
ffirst
Function v1.0(ffirst x)
Same as (first (first x))
source -
filter
Function v1.0(filter pred coll)
^Seq (filter ^Callable pred ^Seqable coll)
Returns a lazy sequence of the items in coll for which
source show types
(pred item) returns true. pred must be free of side-effects. -
filterv
Function v1.0(filterv pred coll)
^Vector (filterv ^Callable pred coll)
Returns a vector of the items in coll for which
source show types
(pred item) returns true. pred must be free of side-effects. -
find
Function v1.0(find map key)
(find ^Associative map key)
Returns the map entry for key, or nil if key not present.
source show types -
find-ns
Function v1.0(find-ns sym)
^Namespace (find-ns ^Symbol sym)
Returns the namespace named by the symbol or nil if it doesn't exist.
source show types -
find-var
Function v1.0(find-var sym)
^Var (find-var ^Symbol sym)
Returns the global var named by the namespace-qualified symbol, or
source show types
nil if no var with that name. -
first
Function v1.0(first coll)
Returns the first item in the collection. Calls seq on its
source
argument. If coll is nil, returns nil. -
flatten
Function v1.0(flatten x)
^Seq (flatten x)
Takes any nested combination of sequential things (lists, vectors,
source show types
etc.) and returns their contents as a single, flat sequence.
(flatten nil) returns an empty sequence. -
float?
Function v1.0(float? n)
^Boolean (float? n)
Returns true if n is a floating point number
source show types -
flush
Function v1.0(flush)
^Nil (flush)
Flushes the output stream that is the current value of
source show types
*out* -
fn
Special form v1.0(fn name? [params*] exprs*)
(fn name? ([params*] exprs*) +)
params => positional-params* , or positional-params* & next-param
source
positional-param => binding-form
next-param => binding-form
name => symbol
Defines a function -
fn?
Function v1.0(fn? x)
^Boolean (fn? x)
Returns true if x is Fn, i.e. is an object created via fn.
source show types -
fnext
Function v1.0(fnext x)
Same as (first (next x))
source -
fnil
Function v1.0(fnil f x)
^Fn (fnil ^Callable f x)
(fnil f x y)
^Fn (fnil ^Callable f x y)
(fnil f x y z)
^Fn (fnil ^Callable f x y z)
Takes a function f, and returns a function that calls f, replacing
source show types
a nil first argument to f with the supplied value x. Higher arity
versions can replace arguments in the second and third
positions (y, z). Note that the function f can take any number of
arguments, not just the one(s) being nil-patched. -
for
Macro v1.0(for seq-exprs body-expr)
List comprehension. Takes a vector of one or more
source
binding-form/collection-expr pairs, each followed by zero or more
modifiers, and yields a lazy sequence of evaluations of expr.
Collections are iterated in a nested fashion, rightmost fastest,
and nested coll-exprs can refer to bindings created in prior
binding-forms. Supported modifiers are: :let [binding-form expr ...],
:while test, :when test.
(take 100 (for [x (range 100000000) y (range 1000000) :while (< y x)] [x y])) -
force
Function v1.0(force x)
If x is a Delay, returns the (possibly cached) value of its expression, else returns x
source -
format
Function v1.0(format fmt & args)
^String (format ^String fmt & args)
Formats a string using fmt.Sprintf
source show types -
frequencies
Function v1.0(frequencies coll)
^Map (frequencies coll)
Returns a map from distinct items in coll to the number of times
source show types
they appear. -
gensym
Function v1.0(gensym)
^Symbol (gensym)
(gensym prefix-string)
^Symbol (gensym ^String prefix-string)
Returns a new symbol with a unique name. If a prefix string is
source show types
supplied, the name is prefix# where # is some unique number. If
prefix is not supplied, the prefix is 'G__'. -
get
Function v1.0(get map key)
(get map key not-found)
Returns the value mapped to key, not-found or nil if key not present.
source
When map is a GoObject, the underlying object can be a struct, map,
array, slice, or string; for a struct, the key must evaluate to a
symbol. However, rather than (get obj 'FieldName), consider
(. obj FieldName).
"Undocumented": When map is a GoObject with underlying struct or
map, an empty-string key returns (for documentation purposes) a
vector of strings comprising the struct's field, or map's key,
names. -
get-in
Function v1.0(get-in m ks)
(get-in m ^Seqable ks)
(get-in m ks not-found)
(get-in m ^Seqable ks not-found)
Returns the value in a nested associative structure,
source show types
where ks is a sequence of keys. Returns nil if the key
is not present, or the not-found value if supplied. -
get-method
Function v1.0(get-method multifn dispatch-val)
^Fn (get-method multifn dispatch-val)
Given a multimethod and a dispatch value, returns the dispatch fn
source show types
that would apply to that value, or nil if none apply and no default -
go
Macro v1.0(go & body)
Schedules the body to run inside a goroutine.
source
Immediately returns a channel which will receive the result of the body when
completed.
If exception is thrown inside the body, it will be caught and re-thrown upon
reading from the returned channel.
Joker is single threaded and uses the GIL (Global Interpreter Lock) to make sure
only one goroutine (including the root one) executes at the same time.
However, channel operations and some I/O functions (joker.http/send, joker.os/sh*, joker.os/exec,
and joker.time/sleep) release the GIL and allow other goroutines to run.
So using goroutines only makes sense if you do I/O (specifically, calling the above functions)
inside them. Also, note that a goroutine may never have a chance to run if the root goroutine
(or another goroutine) doesn't do any I/O or channel operations (<! or >!). -
goobject?
Function v1.0(goobject? obj)
Returns true if obj is a GoObject.
source -
group-by
Function v1.0(group-by f coll)
^Map (group-by ^Callable f coll)
Returns a map of the elements of coll keyed by the result of
source show types
f on each element. The value at each key will be a vector of the
corresponding elements, in the order they appeared in coll. -
hash
Function v1.0(hash x)
^Int (hash x)
Returns the hash code of its argument.
source show types -
hash-map
Function v1.0(hash-map & keyvals)
keyval => key val
source
Returns a new hash map with supplied mappings. If any keys are
equal, they are handled as if by repeated uses of assoc. -
hash-set
Function v1.0(hash-set & keys)
Returns a new hash set with supplied keys. Any equal keys are
source
handled as if by repeated uses of conj. -
ident?
Function v1.0(ident? x)
^Boolean (ident? x)
Return true if x is a symbol or keyword
source show types -
identical?
Function v1.0(identical? x y)
^Boolean (identical? x y)
Tests if 2 arguments are the same object
source show types -
identity
Function v1.0(identity x)
Returns its argument.
source -
if-let
Macro v1.0(if-let bindings then)
(if-let bindings then else & oldform)
bindings => binding-form test
source
If test is true, evaluates then with binding-form bound to the value of
test, if not, yields else -
if-not
Macro v1.0(if-not test then)
(if-not test then else)
Evaluates test. If logical false, evaluates and returns then expr,
source
otherwise else expr, if supplied, else nil. -
if-some
Macro v1.0(if-some bindings then)
(if-some bindings then else & oldform)
bindings => binding-form test
source
If test is not nil, evaluates then with binding-form bound to the
value of test, if not, yields else -
in-ns
Function v1.0(in-ns name)
^Namespace (in-ns ^Symbol name)
Sets *ns* to the namespace named by the symbol, creating it if needed.
source show types -
inc
Function v1.0(inc x)
^Number (inc ^Number x)
Returns a number one greater than num. Does not auto-promote
source show types
ints, will overflow. See also: inc' -
inc'
Function v1.0(inc' x)
^Number (inc' ^Number x)
Returns a number one greater than num. Supports arbitrary precision.
source show types
See also: inc -
indexed?
Function v1.0(indexed? coll)
^Boolean (indexed? coll)
Return true if coll implements Indexed, indicating efficient lookup by index
source show types -
instance?
Function v1.0(instance? c x)
Evaluates x and tests if it is an instance of type
source
c. Returns true or false -
int
Function v1.0(int x)
^Int (int x)
Coerce to int
source show types -
int?
Function v1.0(int? x)
^Boolean (int? x)
Return true if x is a fixed precision integer
source show types -
integer?
Function v1.0(integer? n)
^Boolean (integer? n)
Returns true if n is an integer
source show types -
interleave
Function v1.0(interleave)
^Seq (interleave)
(interleave c1)
^Seq (interleave ^Seqable c1)
(interleave c1 c2)
^Seq (interleave ^Seqable c1 ^Seqable c2)
(interleave c1 c2 & colls)
^Seq (interleave ^Seqable c1 ^Seqable c2 & colls)
Returns a lazy seq of the first item in each coll, then the second etc.
source show types -
intern
Function v1.0(intern ns name)
^Var (intern ns ^Symbol name)
(intern ns name val)
^Var (intern ns ^Symbol name val)
Finds or creates a var named by the symbol name in the namespace
source show types
ns (which can be a symbol or a namespace), setting its root binding
to val if supplied. The namespace must exist. The var will adopt any
metadata from the name symbol. Returns the var. -
interpose
Function v1.0(interpose sep coll)
^Seq (interpose sep ^Seqable coll)
Returns a lazy seq of the elements of coll separated by sep.
source show types
Returns a stateful transducer when no collection is provided. -
into
Function v1.0(into to from)
Returns a new coll consisting of to-coll with all of the items of
source
from-coll conjoined. -
iterate
Function v1.0(iterate f x)
^Seq (iterate ^Callable f x)
Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects
source show types -
joker-version
Function v1.0(joker-version)
^String (joker-version)
Returns joker version as a printable string.
source show types -
juxt
Function v1.0(juxt f)
^Fn (juxt ^Callable f)
(juxt f g)
^Fn (juxt ^Callable f ^Callable g)
(juxt f g h)
^Fn (juxt ^Callable f ^Callable g ^Callable h)
(juxt f g h & fs)
^Fn (juxt ^Callable f ^Callable g ^Callable h & fs)
Takes a set of functions and returns a fn that is the juxtaposition
source show types
of those fns. The returned fn takes a variable number of args, and
returns a vector containing the result of applying each fn to the
args (left-to-right).
((juxt a b c) x) => [(a x) (b x) (c x)] -
keep
Function v1.0(keep f coll)
^Seq (keep ^Callable f ^Seqable coll)
Returns a lazy sequence of the non-nil results of (f item). Note,
source show types
this means false return values will be included. f must be free of
side-effects. -
keep-indexed
Function v1.0(keep-indexed f coll)
^Seq (keep-indexed ^Callable f ^Seqable coll)
Returns a lazy sequence of the non-nil results of (f index item). Note,
source show types
this means false return values will be included. f must be free of
side-effects. -
key
Function v1.0(key e)
Returns the key of the map entry.
source -
keys
Function v1.0(keys map)
^Seq (keys ^Map map)
Returns a sequence of the map's keys, in the same order as (seq map).
source show types -
keyword
Function v1.0(keyword name)
^Keyword (keyword name)
(keyword ns name)
^Keyword (keyword ns name)
Returns a Keyword with the given namespace and name. Do not use :
source show types
in the keyword strings, it will be added automatically. -
keyword?
Function v1.0(keyword? x)
^Boolean (keyword? x)
Return true if x is a Keyword
source show types -
last
Function v1.0(last coll)
Return the last item in coll, in linear time.
source -
lazy-cat
Macro v1.0(lazy-cat & colls)
Expands to code which yields a lazy sequence of the concatenation
source
of the supplied colls. Each coll expr is not evaluated until it is
needed.
(lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs)) -
lazy-seq
Macro v1.0(lazy-seq & body)
Takes a body of expressions that returns an ISeq or nil, and yields
source
a Seqable object that will invoke the body only the first time seq
is called, and will cache the result and return it on all subsequent
seq calls. See also - realized? -
let
Special form v1.0(let [bindings*] exprs*)
binding => binding-form init-expr
source
Evaluates the exprs in a lexical context in which the symbols in
the binding-forms are bound to their respective init-exprs or parts
therein. -
letfn
Special form v1.0(letfn [fnspecs*] exprs*)
fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+)
source
Takes a vector of function specs and a body, and generates a set of
bindings of functions to their names. All of the names are available
in all of the definitions of the functions, as well as the body. -
line-seq
Function v1.0(line-seq rdr)
Returns the lines of text from rdr as a lazy sequence of strings.
source
rdr must be File or BufferedReader. -
list
Function v1.0(list & items)
Creates a new list containing the items.
source -
list*
Function v1.0(list* args)
^Seq (list* ^Seqable args)
(list* a args)
^Seq (list* a ^Seqable args)
(list* a b args)
^Seq (list* a b ^Seqable args)
(list* a b c args)
^Seq (list* a b c ^Seqable args)
(list* a b c d & more)
^Seq (list* a b c d & more)
Creates a new list containing the items prepended to the rest, the
source show types
last of which will be treated as a sequence. -
list?
Function v1.0(list? x)
^Boolean (list? x)
Returns true if x is a List
source show types -
load
Function v1.0(load & libs)
^Nil (load & libs)
Loads code from libs, throwing error if cyclic dependency detected,
source show types
and ignoring libs already being loaded. -
load-file
Function v1.0(load-file f)
^Nil (load-file ^String f)
Loads code from file f. Does not protect against recursion.
source show types -
load-string
Function v1.0(load-string s)
(load-string ^String s)
Sequentially read and evaluate the set of forms contained in the
source show types
string -
loaded-libs
Function v1.0(loaded-libs)
^MapSet (loaded-libs)
Returns an UNSORTED set of symbols naming the currently loaded libs
source show types -
loop
Special form v1.0(loop [bindings*] exprs*)
Evaluates the exprs in a lexical context in which the symbols in
source
the binding-forms are bound to their respective init-exprs or parts
therein. Acts as a recur target. -
macroexpand
Function v1.0(macroexpand form)
Repeatedly calls macroexpand-1 on form until it no longer
source
represents a macro form, then returns it. Note neither
macroexpand-1 nor macroexpand expand macros in subforms. -
macroexpand-1
Function v1.0(macroexpand-1 form)
If form represents a macro form, returns its expansion, else returns form.
source -
map
Function v1.0(map f coll)
^Seq (map ^Callable f ^Seqable coll)
(map f c1 c2)
^Seq (map ^Callable f ^Seqable c1 ^Seqable c2)
(map f c1 c2 c3)
^Seq (map ^Callable f ^Seqable c1 ^Seqable c2 ^Seqable c3)
(map f c1 c2 c3 & colls)
^Seq (map ^Callable f ^Seqable c1 ^Seqable c2 ^Seqable c3 & colls)
Returns a lazy sequence consisting of the result of applying f to the
source show types
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments. -
map-indexed
Function v1.0(map-indexed f coll)
^Seq (map-indexed ^Callable f ^Seqable coll)
Returns a lazy sequence consisting of the result of applying f to 0
source show types
and the first item of coll, followed by applying f to 1 and the second
item in coll, etc, until coll is exhausted. Thus function f should
accept 2 arguments, index and item. -
map?
Function v1.0(map? x)
Returns true if x is a map
source -
mapcat
Function v1.0(mapcat f & colls)
^Seq (mapcat ^Callable f & colls)
Returns the result of applying concat to the result of applying map
source show types
to f and colls. Thus function f should return a collection. -
mapv
Function v1.0(mapv f coll)
^Vector (mapv ^Callable f coll)
(mapv f c1 c2)
^Vector (mapv ^Callable f c1 c2)
(mapv f c1 c2 c3)
^Vector (mapv ^Callable f c1 c2 c3)
(mapv f c1 c2 c3 & colls)
^Vector (mapv ^Callable f c1 c2 c3 & colls)
Returns a vector consisting of the result of applying f to the
source show types
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments. -
max
Function v1.0(max x)
^Number (max ^Number x)
(max x y)
^Number (max ^Number x ^Number y)
(max x y & more)
^Number (max ^Number x ^Number y & more)
Returns the greatest of the nums.
source show types -
max-key
Function v1.0(max-key k x)
(max-key ^Callable k x)
(max-key k x y)
(max-key ^Callable k x y)
(max-key k x y & more)
(max-key ^Callable k x y & more)
Returns the x for which (k x), a number, is greatest.
source show types -
memoize
Function v1.0(memoize f)
^Fn (memoize ^Callable f)
Returns a memoized version of a referentially transparent function. The
source show types
memoized version of the function keeps a cache of the mapping from arguments
to results and, when calls with the same arguments are repeated often, has
higher performance at the expense of higher memory use. -
merge
Function v1.0(merge & maps)
^Map (merge & maps)
Returns a map that consists of the rest of the maps conj-ed onto
source show types
the first. If a key occurs in more than one map, the mapping from
the latter (left-to-right) will be the mapping in the result. -
merge-with
Function v1.0(merge-with f & maps)
^Map (merge-with ^Callable f & maps)
Returns a map that consists of the rest of the maps conj-ed onto
source show types
the first. If a key occurs in more than one map, the mapping(s)
from the latter (left-to-right) will be combined with the mapping in
the result by calling (f val-in-result val-in-latter). -
meta
Function v1.0(meta obj)
Returns the metadata of obj, returns nil if there is no metadata.
source -
methods
Function v1.0(methods multifn)
^Map (methods multifn)
Given a multimethod, returns a map of dispatch values -> dispatch fns
source show types -
min
Function v1.0(min x)
^Number (min ^Number x)
(min x y)
^Number (min ^Number x ^Number y)
(min x y & more)
^Number (min ^Number x ^Number y & more)
Returns the least of the nums.
source show types -
min-key
Function v1.0(min-key k x)
(min-key ^Callable k x)
(min-key k x y)
(min-key ^Callable k x y)
(min-key k x y & more)
(min-key ^Callable k x y & more)
Returns the x for which (k x), a number, is least.
source show types -
mod
Function v1.0(mod num div)
^Number (mod ^Number num ^Number div)
Modulus of num and div. Truncates toward negative infinity.
source show types -
name
Function v1.0(name x)
^String (name x)
Returns the name String of a string, symbol, keyword or any Named object (e.g. File).
source show types -
namespace
Function v1.0(namespace x)
^String (namespace ^Named x)
Returns the namespace String of a symbol or keyword, or nil if not present.
source show types -
nat-int?
Function v1.0(nat-int? x)
^Boolean (nat-int? x)
Return true if x is a non-negative fixed precision integer
source show types -
neg-int?
Function v1.0(neg-int? x)
^Boolean (neg-int? x)
Return true if x is a negative fixed precision integer
source show types -
neg?
Function v1.0(neg? x)
^Boolean (neg? ^Number x)
Returns true if num is less than zero, else false
source show types -
new
Function v1.0(new t init)
(new ^GoType t ^Vector|Map init)
Constructs a new GoObject given a GoType and (possibly optional) initial values in the form of a vector of the values or a map of the values.
source show types
May be abbreviated as (t. init).
Note: unlike in Clojure, (new ...) is not a special form. -
newline
Function v1.0(newline)
^Nil (newline)
Writes a platform-specific newline to *out*
source show types -
next
Function v1.0(next coll)
Returns a seq of the items after the first. Calls seq on its
source
argument. If there are no more items, returns nil. -
nfirst
Function v1.0(nfirst x)
Same as (next (first x))
source -
nil?
Function v1.0(nil? x)
Returns true if x is nil, false otherwise.
source -
nnext
Function v1.0(nnext x)
Same as (next (next x))
source -
not
Function v1.0(not x)
^Boolean (not x)
Returns true if x is logical false, false otherwise.
source show types -
not-any?
Function v1.0(not-any? pred coll)
Returns false if (pred x) is logical true for any x in coll,
source
else true. -
not-empty
Function v1.0(not-empty coll)
^Seqable (not-empty ^Seqable coll)
If coll is empty, returns nil, else coll
source show types -
not-every?
Function v1.0(not-every? pred coll)
Returns false if (pred x) is logical true for every x in
source
coll, else true. -
not=
Function v1.0(not= x)
^Boolean (not= x)
(not= x y)
^Boolean (not= x y)
(not= x y & more)
^Boolean (not= x y & more)
Same as (not (= obj1 obj2))
source show types -
ns
Macro v1.0(ns name docstring? attr-map? references*)
Sets *ns* to the namespace named by name (unevaluated), creating it
source
if needed. references can be zero or more of:
(:require ...) (:use ...) (:load ...)
with the syntax of require/use/load
respectively, except the arguments are unevaluated and need not be
quoted. Use of ns is preferred to
individual calls to in-ns/require/use:
(ns foo.bar
(:require [my.lib1 :as lib1])
(:use [my.lib2])) -
ns-aliases
Function v1.0(ns-aliases ns)
^Map (ns-aliases ns)
Returns a map of the aliases for the namespace.
source show types -
ns-interns
Function v1.0(ns-interns ns)
^Map (ns-interns ns)
Returns a map of the intern mappings for the namespace.
source show types -
ns-map
Function v1.0(ns-map ns)
^Map (ns-map ns)
Returns a map of all the mappings for the namespace.
source show types -
ns-name
Function v1.0(ns-name ns)
^Symbol (ns-name ns)
Returns the name of the namespace, a symbol.
source show types -
ns-publics
Function v1.0(ns-publics ns)
^Map (ns-publics ns)
Returns a map of the public intern mappings for the namespace.
source show types -
ns-refers
Function v1.0(ns-refers ns)
^Map (ns-refers ns)
Returns a map of the refer mappings for the namespace.
source show types -
ns-resolve
Function v1.0(ns-resolve ns sym)
^Var (ns-resolve ns ^Symbol sym)
(ns-resolve ns env sym)
^Var (ns-resolve ns ^Gettable env ^Symbol sym)
Returns the var or type to which a symbol will be resolved in the
source show types
namespace (unless found in the environment), else nil. Note that
if the symbol is fully qualified, the var/Type to which it resolves
need not be present in the namespace. -
ns-sources
Function v1.0(ns-sources sources)
^Nil (ns-sources ^Map sources)
Adds namespace mappings to the built-in variable *ns-sources*
source show types
The key/value pairs in the map define how to resolve external
dependencies. They are appended to the *ns-sources* vector in
arbitrary order; so, use separate invocations of this function
to add narrower keys before wider.
Each value is itself a map containing (primarily) a :url key whose
value is the URL of the resource. Only http:// and https:// are
currently supported; everything else is treated as a local
pathname. HTTP URLs are cached in $HOME/.jokerd/deps/. -
ns-unalias
Function v1.0(ns-unalias ns sym)
^Nil (ns-unalias ns ^Symbol sym)
Removes the alias for the symbol from the namespace.
source show types -
ns-unmap
Function v1.0(ns-unmap ns sym)
^Nil (ns-unmap ns ^Symbol sym)
Removes the mappings for the symbol from the namespace.
source show types -
nth
Function v1.0(nth coll index)
(nth coll ^Number index)
(nth coll index not-found)
(nth coll ^Number index not-found)
Returns the value at the index. get returns nil if index out of
source show types
bounds, nth throws an exception unless not-found is supplied. nth
also works, in O(n) time, for strings and sequences. -
nthnext
Function v1.0(nthnext coll n)
^Seq (nthnext ^Seqable coll ^Number n)
Returns the nth next of coll, (seq coll) when n is 0.
source show types -
nthrest
Function v1.0(nthrest coll n)
^Seq (nthrest ^Seqable coll ^Number n)
Returns the nth rest of coll, coll when n is 0.
source show types -
num
Function v1.0(num x)
^Number (num ^Number x)
Coerce to Number
source show types -
number?
Function v1.0(number? x)
^Boolean (number? x)
Returns true if x is a Number
source show types -
numerator
Function v1.0(numerator r)
^Number (numerator ^Ratio r)
Returns the numerator part of a Ratio.
source show types -
odd?
Function v1.0(odd? n)
^Boolean (odd? n)
Returns true if n is odd, throws an exception if n is not an integer
source show types -
or
Macro v1.0(or)
(or x)
(or x & next)
Evaluates exprs one at a time, from left to right. If a form
source
returns a logical true value, or returns that value and doesn't
evaluate any of the other expressions, otherwise it returns the
value of the last expression. (or) returns nil. -
partial
Function v1.0(partial f)
^Fn (partial ^Callable f)
(partial f arg1)
^Fn (partial ^Callable f arg1)
(partial f arg1 arg2)
^Fn (partial ^Callable f arg1 arg2)
(partial f arg1 arg2 arg3)
^Fn (partial ^Callable f arg1 arg2 arg3)
(partial f arg1 arg2 arg3 & more)
^Fn (partial ^Callable f arg1 arg2 arg3 & more)
Takes a function f and fewer than the normal arguments to f, and
source show types
returns a fn that takes a variable number of additional args. When
called, the returned function calls f with args + additional args. -
partition
Function v1.0(partition n coll)
^Seq (partition ^Number n ^Seqable coll)
(partition n step coll)
^Seq (partition ^Number n ^Number step ^Seqable coll)
(partition n step pad coll)
^Seq (partition ^Number n ^Number step ^Seqable pad ^Seqable coll)
Returns a lazy sequence of lists of n items each, at offsets step
source show types
apart. If step is not supplied, defaults to n, i.e. the partitions
do not overlap. If a pad collection is supplied, use its elements as
necessary to complete last partition upto n items. In case there are
not enough padding elements, return a partition with less than n items. -
partition-all
Function v1.0(partition-all n coll)
^Seq (partition-all ^Number n ^Seqable coll)
(partition-all n step coll)
^Seq (partition-all ^Number n ^Number step ^Seqable coll)
Returns a lazy sequence of lists like partition, but may include
source show types
partitions with fewer than n items at the end. -
partition-by
Function v1.0(partition-by f coll)
^Seq (partition-by ^Callable f ^Seqable coll)
Applies f to each value in coll, splitting it each time f returns a
source show types
new value. Returns a lazy seq of partitions. -
peek
Function v1.0(peek coll)
(peek ^Stack coll)
For a list, same as first, for a vector, same as, but much
source show types
more efficient than, last. If the collection is empty, returns nil. -
pop
Function v1.0(pop coll)
(pop ^Stack coll)
For a list, returns a new list without the first
source show types
item, for a vector, returns a new vector without the last item. If
the collection is empty, throws an exception. Note - not the same
as next/butlast. -
pos-int?
Function v1.0(pos-int? x)
^Boolean (pos-int? x)
Return true if x is a positive fixed precision integer
source show types -
pos?
Function v1.0(pos? x)
^Boolean (pos? ^Number x)
Returns true if num is greater than zero, else false
source show types -
pprint
Function v1.0(pprint x)
^Nil (pprint x)
Pretty prints x to the output stream that is the current value of *out*.
source show types -
pr
Function v1.0(pr & args)
Prints the object(s) to the output stream that is the current value
source
of *out*. Prints the object(s), separated by spaces if there is
more than one. By default, pr and prn print in a way that objects
can be read by the reader -
pr-err
Function v1.0(pr-err & xs)
^Nil (pr-err & xs)
pr to *err*
source show types -
pr-str
Function v1.0(pr-str & xs)
^String (pr-str & xs)
pr to a string, returning it
source show types -
prefer-method
Function v1.0(prefer-method multifn dispatch-val-x dispatch-val-y)
Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y
source
when there is a conflict -
prefers
Function v1.0(prefers multifn)
^Map (prefers multifn)
Given a multimethod, returns a map of preferred value -> set of other values
source show types -
print
Function v1.0(print & more)
^Nil (print & more)
Prints the object(s) to the output stream that is the current value
source show types
of *out*. print and println produce output for human consumption. -
print-err
Function v1.0(print-err & xs)
^Nil (print-err & xs)
print to *err*
source show types -
print-str
Function v1.0(print-str & xs)
^String (print-str & xs)
print to a string, returning it
source show types -
printf
Function v1.0(printf fmt & args)
^Nil (printf ^String fmt & args)
Prints formatted output, as per format
source show types -
println
Function v1.0(println & more)
^Nil (println & more)
Same as print followed by (newline)
source show types -
println-err
Function v1.0(println-err & xs)
^Nil (println-err & xs)
println to *err*
source show types -
println-str
Function v1.0(println-str & xs)
^String (println-str & xs)
println to a string, returning it
source show types -
prn
Function v1.0(prn & more)
^Nil (prn & more)
Same as pr followed by (newline). Observes *flush-on-newline*
source show types -
prn-err
Function v1.0(prn-err & xs)
^Nil (prn-err & xs)
prn to *err*
source show types -
prn-str
Function v1.0(prn-str & xs)
^String (prn-str & xs)
prn to a string, returning it
source show types -
qualified-ident?
Function v1.0(qualified-ident? x)
^Boolean (qualified-ident? x)
Return true if x is a symbol or keyword with a namespace
source show types -
qualified-keyword?
Function v1.0(qualified-keyword? x)
^Boolean (qualified-keyword? x)
Return true if x is a keyword with a namespace
source show types -
qualified-symbol?
Function v1.0(qualified-symbol? x)
^Boolean (qualified-symbol? x)
Return true if x is a symbol with a namespace
source show types -
quot
Function v1.0(quot num div)
^Number (quot ^Number num ^Number div)
quot[ient] of dividing numerator by denominator.
source show types -
rand
Function v1.0(rand)
^Double (rand)
(rand n)
^Double (rand ^Number n)
Returns a random floating point number between 0 (inclusive) and
source show types
n (default 1) (exclusive). -
rand-int
Function v1.0(rand-int n)
^Int (rand-int ^Number n)
Returns a random integer between 0 (inclusive) and n (exclusive).
source show types -
rand-nth
Function v1.0(rand-nth coll)
Return a random element of the (sequential) collection. Will have
source
the same performance characteristics as nth for the given
collection. -
random-sample
Function v1.0(random-sample prob coll)
^Seq (random-sample ^Number prob ^Seqable coll)
Returns items from coll with random probability of prob (0.0 -
source show types
1.0). -
range
Function v1.0(range)
^Seq (range)
(range end)
^Seq (range ^Number end)
(range start end)
^Seq (range ^Number start ^Number end)
(range start end step)
^Seq (range ^Number start ^Number end ^Number step)
Returns a lazy seq of nums from start (inclusive) to end
source show types
(exclusive), by step, where start defaults to 0, step to 1, and end to
infinity. When step is equal to 0, returns an infinite sequence of
start. When start is equal to end, returns empty list. -
ratio?
Function v1.0(ratio? n)
^Boolean (ratio? n)
Returns true if n is a Ratio
source show types -
rational?
Function v1.0(rational? n)
^Boolean (rational? n)
Returns true if n is a rational number
source show types -
re-find
Function v1.0(re-find re s)
(re-find ^Regex re ^String s)
Returns the leftmost regex match, if any, of string to pattern.
source show types -
re-matches
Function v1.0(re-matches re s)
(re-matches ^Regex re ^String s)
Returns the match, if any, of string to pattern.
source show types -
re-pattern
Function v1.0(re-pattern s)
^Regex (re-pattern s)
Returns an instance of Regex
source show types -
re-seq
Function v1.0(re-seq re s)
^Seq (re-seq ^Regex re ^String s)
Returns a sequence of successive matches of pattern in string
source show types -
read
Function v1.0(read)
(read reader)
Reads the next object from reader (defaults to *in*)
source -
read-line
Function v1.0(read-line)
Reads the next line from *in*. Returns nil if an error (such as EOF) is detected.
source -
read-string
Function v1.0(read-string s)
Reads one object from the string s.
source -
realized?
Function v1.0(realized? x)
^Boolean (realized? ^Pending x)
Returns true if a value has been produced for a delay or lazy sequence.
source show types -
reduce
Function v1.0(reduce f coll)
(reduce ^Callable f coll)
(reduce f val coll)
(reduce ^Callable f val coll)
f should be a function of 2 arguments. If val is not supplied,
source show types
returns the result of applying f to the first 2 items in coll, then
applying f to that result and the 3rd item, etc. If coll contains no
items, f must accept no arguments as well, and reduce returns the
result of calling f with no arguments. If coll has only 1 item, it
is returned and f is not called. If val is supplied, returns the
result of applying f to val and the first item in coll, then
applying f to that result and the 2nd item, etc. If coll contains no
items, returns val and f is not called. -
reduce-kv
Function v1.0(reduce-kv f init coll)
(reduce-kv ^Callable f init coll)
Reduces an associative collection. f should be a function of 3
source show types
arguments. Returns the result of applying f to init, the first key
and the first value in coll, then applying f to that result and the
2nd key and value, etc. If coll contains no entries, returns init
and f is not called. Note that reduce-kv is supported on vectors,
where the keys will be the ordinals. -
reductions
Function v1.0(reductions f coll)
^Seq (reductions ^Callable f ^Seqable coll)
(reductions f init coll)
^Seq (reductions ^Callable f init ^Seqable coll)
Returns a lazy seq of the intermediate values of the reduction (as
source show types
per reduce) of coll by f, starting with init. -
refer
Function v1.0(refer ns-sym & filters)
^Nil (refer ^Symbol ns-sym & filters)
refers to all public vars of ns, subject to filters.
source show types
filters can include at most one each of:
:exclude list-of-symbols
:only list-of-symbols
:rename map-of-fromsymbol-tosymbol
For each public interned var in the namespace named by the symbol,
adds a mapping from the name of the var to the var to the current
namespace. Throws an exception if name is already mapped to
something else in the current namespace. Filters can be used to
select a subset, via inclusion or exclusion, or to provide a mapping
to a symbol different from the var's name, in order to prevent
clashes. Use :use in the ns macro in preference to calling this directly. -
refer-clojure
Macro v1.0(refer-clojure & filters)
Same as (refer 'joker.core <filters>)
source -
rem
Function v1.0(rem num div)
^Number (rem ^Number num ^Number div)
remainder of dividing numerator by denominator.
source show types -
remove
Function v1.0(remove pred coll)
^Seq (remove ^Callable pred ^Seqable coll)
Returns a lazy sequence of the items in coll for which
source show types
(pred item) returns false. pred must be free of side-effects. -
remove-all-methods
Function v1.0(remove-all-methods multifn)
Removes all of the methods of multimethod.
source -
remove-method
Function v1.0(remove-method multifn dispatch-val)
Removes the method of multimethod associated with dispatch-value.
source -
remove-ns
Function v1.0(remove-ns sym)
^Namespace (remove-ns ^Symbol sym)
Removes the namespace named by the symbol. Use with caution.
source show types
Cannot be used to remove the clojure namespace. -
repeat
Function v1.0(repeat x)
^Seq (repeat x)
(repeat n x)
^Seq (repeat ^Number n x)
Returns a lazy (infinite!, or length n if supplied) sequence of xs.
source show types -
repeatedly
Function v1.0(repeatedly f)
^Seq (repeatedly ^Callable f)
(repeatedly n f)
^Seq (repeatedly ^Number n ^Callable f)
Takes a function of no args, presumably with side effects, and
source show types
returns an infinite (or length n if supplied) lazy sequence of calls
to it -
replace
Function v1.0(replace smap coll)
(replace ^Associative smap ^Seqable coll)
Given a map of replacement pairs and a vector/collection, returns a
source show types
vector/seq with any elements = a key in smap replaced with the
corresponding val in smap. -
require
Function v1.0(require & args)
^Nil (require & args)
Loads libs, skipping any that are already loaded. Each argument is
source show types
either a libspec that identifies a lib, a prefix list that
identifies multiple libs whose names share a common prefix, or a
flag that modifies how all the identified libs are
loaded. Use :require in the ns macro in preference to calling this
directly.
Libs
A 'lib' is a named set of resources in *classpath* whose contents
define a library of Clojure code. Lib names are symbols and each lib
is associated with a Clojure namespace and a Joker package that
share its name. A lib's name also locates its root directory within
*classpath* using its package name to classpath-relative path
mapping. All resources in a lib should be contained in the directory
structure under its root directory. All definitions a lib makes
should be in its associated namespace.
'require loads a lib by loading its root resource. The root resource
path is derived from the lib name in the following manner: Consider
a lib named by the symbol 'x.y.z; it has the root directory
<*classpath*>/x/y/, and its root resource is
<*classpath*>/x/y/z.clj. The root resource should contain code to
create the lib's namespace (usually by using the ns macro) and load
any additional lib resources.
Libspecs
A libspec is a lib name or a vector containing a lib name followed
by options expressed as sequential keywords and arguments.
Recognized options:
:as takes a symbol as its argument and makes that symbol an alias to the
lib's namespace in the current namespace.
:refer takes a list of symbols to refer from the namespace or the :all
keyword to bring in all public vars.
Prefix Lists
It's common for Clojure code to depend on several libs whose names have
the same prefix. When specifying libs, prefix lists can be used to reduce
repetition. A prefix list contains the shared prefix followed by libspecs
with the shared prefix removed from the lib names. After removing the
prefix, the names that remain must not contain any periods.
Flags
A flag is a keyword.
Recognized flags: :reload, :reload-all, :verbose
:reload forces loading of all the identified libs even if they are
already loaded
:reload-all implies :reload and also forces loading of all libs that the
identified libs directly or indirectly load via require or use
:verbose triggers printing information about each load, alias, and refer
Example:
The following would load the libraries clojure.zip and clojure.set
abbreviated as 's'.
(require '(clojure zip [set :as s])) -
requiring-resolve
Function v1.0(requiring-resolve sym)
^Var (requiring-resolve sym)
Resolves namespace-qualified sym per 'resolve'. If initial resolve
source show types
fails, attempts to require sym's namespace and retries. -
reset!
Function v1.0(reset! atom newval)
(reset! ^Atom atom newval)
Sets the value of atom to newval without regard for the
source show types
current value. Returns newval. -
reset-meta!
Function v1.0(reset-meta! ref metadata-map)
(reset-meta! ^Ref ref ^Map metadata-map)
Atomically resets the metadata for a namespace/var/atom
source show types -
reset-vals!
Function v1.0(reset-vals! atom newval)
^Vector (reset-vals! ^Atom atom newval)
Sets the value of atom to newval. Returns [old new], the value of the
source show types
atom before and after the reset. -
resolve
Function v1.0(resolve sym)
^Var (resolve ^Symbol sym)
(resolve env sym)
^Var (resolve ^Gettable env ^Symbol sym)
Same as (ns-resolve *ns* sym) or (ns-resolve *ns* env sym)
source show types -
rest
Function v1.0(rest coll)
Returns a possibly empty seq of the items after the first. Calls seq on its
source
argument. -
reverse
Function v1.0(reverse coll)
^Collection (reverse ^Seqable coll)
Returns a seq of the items in coll in reverse order. Not lazy.
source show types -
reversible?
Function v1.0(reversible? coll)
^Boolean (reversible? coll)
Returns true if coll implements Reversible
source show types -
rseq
Function v1.0(rseq rev)
^Seq (rseq ^Reversible rev)
Returns, in constant time, a seq of the items in rev (which
source show types
can be a vector or sorted-map), in reverse order. If rev is empty returns nil. -
run!
Function v1.0(run! proc coll)
^Nil (run! ^Callable proc coll)
Runs the supplied procedure (via reduce), for purposes of side
source show types
effects, on successive items in the collection. Returns nil. -
second
Function v1.0(second x)
Same as (first (next x))
source -
select-keys
Function v1.0(select-keys map keyseq)
^Map (select-keys ^Associative map ^Seqable keyseq)
Returns a map containing only those entries in map whose key is in keys
source show types -
seq
Function v1.0(seq coll)
Returns a seq on the collection. If the collection is
source
empty, returns nil. (seq nil) returns nil. -
seq?
Function v1.0(seq? x)
Returns true if x is a sequence
source -
seqable?
Function v1.0(seqable? x)
^Boolean (seqable? x)
Return true if the seq function is supported for x
source show types -
sequence
Function v1.0(sequence coll)
^Seq (sequence coll)
Coerces coll to a (possibly empty) sequence, if it is not already
source show types
one. Will not force a lazy seq. (sequence nil) yields () -
sequential?
Function v1.0(sequential? coll)
^Boolean (sequential? coll)
Returns true if coll implements Sequential
source show types -
set
Function v1.0(set coll)
^MapSet (set ^Seqable coll)
Returns a set of the distinct elements of coll.
source show types -
set?
Function v1.0(set? x)
^Boolean (set? x)
Returns true if x implements Set
source show types -
shuffle
Function v1.0(shuffle coll)
^Vector (shuffle coll)
Return a random permutation of coll
source show types -
simple-ident?
Function v1.0(simple-ident? x)
^Boolean (simple-ident? x)
Return true if x is a symbol or keyword without a namespace
source show types -
simple-keyword?
Function v1.0(simple-keyword? x)
^Boolean (simple-keyword? x)
Return true if x is a keyword without a namespace
source show types -
simple-symbol?
Function v1.0(simple-symbol? x)
^Boolean (simple-symbol? x)
Return true if x is a symbol without a namespace
source show types -
slurp
Function v1.0(slurp f)
^String (slurp f)
Opens file f and reads all its contents, returning a string.
source show types
f can be a string (filename) or a reader object like *in* or
the one returned by joker.os/open. -
some
Function v1.0(some pred coll)
(some ^Callable pred ^Seqable coll)
Returns the first logical true value of (pred x) for any x in coll,
source show types
else nil. One common idiom is to use a set as pred, for example
this will return :fred if :fred is in the sequence, otherwise nil:
(some #{:fred} coll) -
some->
Macro v1.0(some-> expr & forms)
When expr is not nil, threads it into the first form (via ->),
source
and when that result is not nil, through the next etc. -
some->>
Macro v1.0(some->> expr & forms)
When expr is not nil, threads it into the first form (via ->>),
source
and when that result is not nil, through the next etc. -
some-fn
Function v1.0(some-fn p)
^Fn (some-fn ^Callable p)
(some-fn p1 p2)
^Fn (some-fn ^Callable p1 ^Callable p2)
(some-fn p1 p2 p3)
^Fn (some-fn ^Callable p1 ^Callable p2 ^Callable p3)
(some-fn p1 p2 p3 & ps)
^Fn (some-fn ^Callable p1 ^Callable p2 ^Callable p3 & ps)
Takes a set of predicates and returns a function f that returns the first logical true value
source show types
returned by one of its composing predicates against any of its arguments, else it returns
logical false. Note that f is short-circuiting in that it will stop execution on the first
argument that triggers a logical true result against the original predicates. -
some?
Function v1.0(some? x)
Returns true if x is not nil, false otherwise.
source -
sort
Function v1.0(sort coll)
^Seq (sort ^Seqable coll)
(sort comp coll)
^Seq (sort ^Comparator comp ^Seqable coll)
Returns a sorted sequence of the items in coll. If no comparator is
source show types
supplied, uses compare. -
sort-by
Function v1.0(sort-by keyfn coll)
^Seq (sort-by ^Callable keyfn ^Seqable coll)
(sort-by keyfn comp coll)
^Seq (sort-by ^Callable keyfn ^Comparator comp ^Seqable coll)
Returns a sorted sequence of the items in coll, where the sort
source show types
order is determined by comparing (keyfn item). If no comparator is
supplied, uses compare. -
special-symbol?
Function v1.0(special-symbol? s)
^Boolean (special-symbol? s)
Returns true if s names a special form
source show types -
spit
Function v1.0(spit f content & options)
^Nil (spit f content & options)
Opposite of slurp. Opens file f, writes content, then
source show types
closes f.
f can be a string (filename) or a writer object like *out* or
the one returned by joker.os/create. -
split-at
Function v1.0(split-at n coll)
^Vector (split-at ^Number n ^Seqable coll)
Returns a vector of [(take n coll) (drop n coll)]
source show types -
split-with
Function v1.0(split-with pred coll)
^Vector (split-with ^Callable pred ^Seqable coll)
Returns a vector of [(take-while pred coll) (drop-while pred coll)]
source show types -
str
Function v1.0(str & xs)
With no args, returns the empty string. With one arg x, returns
source
string representation of x. (str nil) returns the empty string. With more than
one arg, returns the concatenation of the str values of the args. -
string?
Function v1.0(string? x)
Returns true if x is a String
source -
subs
Function v1.0(subs s start)
^String (subs ^String s ^Number start)
(subs s start end)
^String (subs ^String s ^Number start ^Number end)
Returns the substring of s beginning at start inclusive, and ending
source show types
at end (defaults to length of string), exclusive. -
subvec
Function v1.0(subvec v start)
^Vector (subvec ^Vector v ^Number start)
(subvec v start end)
^Vector (subvec ^Vector v ^Number start ^Number end)
Returns a persistent vector of the items in vector from
source show types
start (inclusive) to end (exclusive). If end is not supplied,
defaults to (count vector). This operation is O(1) and very fast, as
the resulting vector shares structure with the original and no
trimming is done. -
swap!
Function v1.0(swap! atom f & args)
(swap! ^Atom atom ^Callable f & args)
Atomically swaps the value of atom to be:
source show types
(apply f current-value-of-atom args).
Returns the value that was swapped in. -
swap-vals!
Function v1.0(swap-vals! atom f & args)
^Vector (swap-vals! ^Atom atom ^Callable f & args)
Atomically swaps the value of atom to be:
source show types
(apply f current-value-of-atom args). Note that f may be called
multiple times, and thus should be free of side effects.
Returns [old new], the value of the atom before and after the swap. -
symbol
Function v1.0(symbol name)
^Symbol (symbol name)
(symbol ns name)
^Symbol (symbol ns name)
Returns a Symbol with the given namespace and name.
source show types -
symbol?
Function v1.0(symbol? x)
^Boolean (symbol? x)
Return true if x is a Symbol
source show types -
take
Function v1.0(take n coll)
^Seq (take ^Number n ^Seqable coll)
Returns a lazy sequence of the first n items in coll, or all items if
source show types
there are fewer than n. -
take-last
Function v1.0(take-last n coll)
^Seq (take-last ^Number n ^Seqable coll)
Returns a seq of the last n items in coll. Depending on the type
source show types
of coll may be no better than linear time. For vectors, see also subvec. -
take-nth
Function v1.0(take-nth n coll)
^Seq (take-nth ^Number n ^Seqable coll)
Returns a lazy seq of every nth item in coll.
source show types -
take-while
Function v1.0(take-while pred coll)
^Seq (take-while ^Callable pred ^Seqable coll)
Returns a lazy sequence of successive items from coll while
source show types
(pred item) returns true. pred must be free of side-effects. -
test
Function v1.0(test v)
^Keyword (test v)
test [v] finds fn at key :test in var metadata and calls it,
source show types
presuming failure will throw exception -
the-ns
Function v1.0(the-ns x)
^Namespace (the-ns x)
If passed a namespace, returns it. Else, when passed a symbol,
source show types
returns the namespace named by it, throwing an exception if not
found. -
time
Macro v1.0(time expr)
Evaluates expr and prints the time it took. Returns the value of expr.
source -
trampoline
Function v1.0(trampoline f)
(trampoline ^Callable f)
(trampoline f & args)
(trampoline ^Callable f & args)
trampoline can be used to convert algorithms requiring mutual
source show types
recursion without stack consumption. Calls f with supplied args, if
any. If f returns a fn, calls that fn with no arguments, and
continues to repeat, until the return value is not a fn, then
returns that non-fn value. Note that if you want to return a fn as a
final value, you must wrap it in some data structure and unpack it
after trampoline returns. -
tree-seq
Function v1.0(tree-seq branch? children root)
^Seq (tree-seq ^Callable branch? ^Callable children root)
Returns a lazy sequence of the nodes in a tree, via a depth-first walk.
source show types
branch? must be a fn of one arg that returns true if passed a node
that can have children (but may not). children must be a fn of one
arg that returns a sequence of the children. Will only be called on
nodes for which branch? returns true. Root is the root node of the
tree. -
true?
Function v1.0(true? x)
Returns true if x is the value true, false otherwise.
source -
type
Function v1.0(type x)
^Type (type x)
Returns the :type metadata of x, or its Type if none
source show types -
unsigned-bit-shift-right
Function v1.0(unsigned-bit-shift-right x n)
^Int (unsigned-bit-shift-right ^Int x ^Int n)
Bitwise shift right, without sign-extension.
source show types -
update
Function v1.0(update m k f)
^Map (update ^Associative m k ^Callable f)
(update m k f x)
^Map (update ^Associative m k ^Callable f x)
(update m k f x y)
^Map (update ^Associative m k ^Callable f x y)
(update m k f x y z)
^Map (update ^Associative m k ^Callable f x y z)
(update m k f x y z & more)
^Map (update ^Associative m k ^Callable f x y z & more)
'Updates' a value in an associative structure, where k is a
source show types
key and f is a function that will take the old value
and any supplied args and return the new value, and returns a new
structure. If the key does not exist, nil is passed as the old value. -
update-in
Function v1.0(update-in m ks f & args)
^Map (update-in ^Associative m ^Seqable ks ^Callable f & args)
'Updates' a value in a nested associative structure, where ks is a
source show types
sequence of keys and f is a function that will take the old value
and any supplied args and return the new value, and returns a new
nested structure. If any levels do not exist, hash-maps will be
created. -
update-keys
Function v1.1(update-keys m f)
^Map (update-keys m ^Callable f)
m f => {(f k) v ...}
source show types
Given a map m and a function f of 1-argument, returns a new map whose
keys are the result of applying f to the keys of m, mapped to the
corresponding values of m.
f must return a unique key for each key of m, else the behavior is undefined. -
update-vals
Function v1.1(update-vals m f)
^Map (update-vals m ^Callable f)
m f => {k (f v) ...}
source show types
Given a map m and a function f of 1-argument, returns a new map where the keys of m
are mapped to result of applying f to the corresponding values of m. -
use
Function v1.0(use & args)
^Nil (use & args)
Like 'require, but also refers to each lib's namespace using
source show types
joker.core/refer. Use :use in the ns macro in preference to calling
this directly.
'use accepts additional options in libspecs: :exclude, :only, :rename.
The arguments and semantics for :exclude, :only, and :rename are the same
as those documented for joker.core/refer. -
val
Function v1.0(val e)
Returns the value in the map entry.
source -
vals
Function v1.0(vals map)
^Seq (vals ^Map map)
Returns a sequence of the map's values, in the same order as (seq map).
source show types -
var-get
Function v1.0(var-get x)
(var-get ^Var x)
Gets the value in the Var object
source show types -
var-set
Function v1.0(var-set x val)
(var-set ^Var|GoObject x val)
Sets the value in the Var object to val. Returns val.
source show types -
var?
Function v1.0(var? v)
^Boolean (var? v)
Returns true if v is of type Var
source show types -
vary-meta
Function v1.0(vary-meta obj f & args)
(vary-meta obj ^Callable f & args)
Returns an object of the same type and value as obj, with
source show types
(apply f (meta obj) args) as its metadata. -
vec
Function v1.0(vec coll)
Creates a new vector containing the contents of coll.
source -
vector
Function v1.0(vector & args)
^Vector (vector & args)
Creates a new vector containing the args.
source show types -
vector?
Function v1.0(vector? x)
Returns true if x is a vector
source -
when
Macro v1.0(when test & body)
Evaluates test. If logical true, evaluates body in an implicit do.
source -
when-first
Macro v1.0(when-first bindings & body)
bindings => x xs
source
Roughly the same as (when (seq xs) (let [x (first xs)] body)) but xs is evaluated only once -
when-let
Macro v1.0(when-let bindings & body)
bindings => binding-form test
source
When test is true, evaluates body with binding-form bound to the value of test -
when-not
Macro v1.0(when-not test & body)
Evaluates test. If logical false, evaluates body in an implicit do.
source -
when-some
Macro v1.0(when-some bindings & body)
bindings => binding-form test
source
When test is not nil, evaluates body with binding-form bound to the
value of test -
while
Macro v1.0(while test & body)
Repeatedly executes body while test expression is true. Presumes
source
some side-effect will cause test to become false/nil. Returns nil -
with-bindings
Macro v1.0(with-bindings binding-map & body)
Takes a map of Var/value pairs. Sets the vars to the corresponding values.
source
Then executes body. Resets the vars back to the original
values after body was evaluated. Returns the value of body. -
with-bindings*
Function v1.0(with-bindings* binding-map f & args)
(with-bindings* ^Map binding-map ^Callable f & args)
Takes a map of Var/value pairs. Sets the vars to the corresponding values.
source show types
Then calls f with the supplied arguments. Resets the vars back to the original
values after f returned. Returns whatever f returns. -
with-in-str
Macro v1.0(with-in-str s & body)
Evaluates body in a context in which *in* is bound to a fresh
source
Buffer initialized with the string s. -
with-meta
Function v1.0(with-meta obj m)
Returns an object of the same type and value as obj, with
source
map m as its metadata. -
with-out-str
Macro v1.0(with-out-str & body)
Evaluates exprs in a context in which *out* is bound to a fresh
source
Buffer. Returns the string created by any nested printing
calls. -
with-redefs
Macro v1.0(with-redefs bindings & body)
The same as binding
source -
with-redefs-fn
Function v1.0(with-redefs-fn binding-map f & args)
The same as with-bindings*
source -
xml-seq
Function v1.0(xml-seq root)
^Seq (xml-seq root)
A tree seq on the xml elements as per xml/parse
source show types -
zero?
Function v1.0(zero? x)
^Boolean (zero? ^Number x)
Returns true if x is zero, else false
source show types -
zipmap
Function v1.0(zipmap keys vals)
^Map (zipmap ^Seqable keys ^Seqable vals)
Returns a map with the keys mapped to the corresponding vals.
source show types
Types
-
(None.)