diff --git a/core/eval.go b/core/eval.go index 567d4f3f2..2405f7e7b 100644 --- a/core/eval.go +++ b/core/eval.go @@ -73,13 +73,13 @@ func (rt *Runtime) stacktrace() string { name := "global" for _, f := range rt.callstack.frames { pos := f.traceable.Pos() - b.WriteString(fmt.Sprintf(" %s %s:%d:%d\n", name, pos.Filename(), pos.line, pos.column)) + b.WriteString(fmt.Sprintf(" %s %s:%d:%d\n", name, pos.Filename(), pos.startLine, pos.startColumn)) name = f.traceable.Name() if strings.HasPrefix(name, "#'") { name = name[2:] } } - b.WriteString(fmt.Sprintf(" %s %s:%d:%d", name, pos.Filename(), pos.line, pos.column)) + b.WriteString(fmt.Sprintf(" %s %s:%d:%d", name, pos.Filename(), pos.startLine, pos.startColumn)) return b.String() } @@ -125,7 +125,7 @@ func (s *Callstack) String() string { var b bytes.Buffer for _, f := range s.frames { pos := f.traceable.Pos() - b.WriteString(fmt.Sprintf("%s %s:%d:%d\n", f.traceable.Name(), pos.Filename(), pos.line, pos.column)) + b.WriteString(fmt.Sprintf("%s %s:%d:%d\n", f.traceable.Name(), pos.Filename(), pos.startLine, pos.startColumn)) } if b.Len() > 0 { b.Truncate(b.Len() - 1) @@ -159,9 +159,9 @@ func (err *EvalError) WithInfo(info *ObjectInfo) Object { func (err *EvalError) Error() string { if len(err.rt.callstack.frames) > 0 { - return fmt.Sprintf("%s:%d:%d: Eval error: %s\nStacktrace:\n%s", err.pos.Filename(), err.pos.line, err.pos.column, err.msg, err.rt.stacktrace()) + return fmt.Sprintf("%s:%d:%d: Eval error: %s\nStacktrace:\n%s", err.pos.Filename(), err.pos.startLine, err.pos.startColumn, err.msg, err.rt.stacktrace()) } else { - return fmt.Sprintf("%s:%d:%d: Eval error: %s", err.pos.Filename(), err.pos.line, err.pos.column, err.msg) + return fmt.Sprintf("%s:%d:%d: Eval error: %s", err.pos.Filename(), err.pos.startLine, err.pos.startColumn, err.msg) } } @@ -227,8 +227,8 @@ func (expr *DefExpr) Eval(env *LocalEnv) Object { expr.vr.Value = Eval(expr.value, env) } meta := EmptyArrayMap() - meta.Add(MakeKeyword("line"), Int{I: expr.line}) - meta.Add(MakeKeyword("column"), Int{I: expr.column}) + meta.Add(MakeKeyword("line"), Int{I: expr.startLine}) + meta.Add(MakeKeyword("column"), Int{I: expr.startColumn}) meta.Add(MakeKeyword("file"), String{S: *expr.filename}) expr.vr.meta = meta if expr.meta != nil { diff --git a/core/object.go b/core/object.go index 2906d81ec..9be496e15 100644 --- a/core/object.go +++ b/core/object.go @@ -22,9 +22,11 @@ import ( type ( Position struct { - line int - column int - filename *string + endLine int + endColumn int + startLine int + startColumn int + filename *string } Equality interface { Equals(interface{}) bool @@ -556,9 +558,9 @@ func (exInfo *ExInfo) Error() string { } } if len(exInfo.rt.callstack.frames) > 0 { - return fmt.Sprintf("%s:%d:%d: Exception: %s\nStacktrace:\n%s", pos.Filename(), pos.line, pos.column, exInfo.msg.S, exInfo.rt.stacktrace()) + return fmt.Sprintf("%s:%d:%d: Exception: %s\nStacktrace:\n%s", pos.Filename(), pos.startLine, pos.startColumn, exInfo.msg.S, exInfo.rt.stacktrace()) } else { - return fmt.Sprintf("%s:%d:%d: Exception: %s", pos.Filename(), pos.line, pos.column, exInfo.msg.S) + return fmt.Sprintf("%s:%d:%d: Exception: %s", pos.Filename(), pos.startLine, pos.startColumn, exInfo.msg.S) } } diff --git a/core/parse.go b/core/parse.go index 2858027c7..e317831e7 100644 --- a/core/parse.go +++ b/core/parse.go @@ -290,7 +290,7 @@ func (err ParseError) Error() string { line, column, filename := 0, 0, "" info := err.obj.GetInfo() if info != nil { - line, column, filename = info.line, info.column, info.Filename() + line, column, filename = info.startLine, info.startColumn, info.Filename() } return fmt.Sprintf("%s:%d:%d: Parse error: %s", filename, line, column, err.msg) } @@ -679,7 +679,7 @@ func parseLetLoop(obj Object, isLoop bool, ctx *ParseContext) *LetExpr { res.body = parseBody(obj.(Seq).Rest().Rest(), ctx) if len(res.body) == 0 { pos := GetPosition(obj) - fmt.Fprintf(os.Stderr, "%s:%d:%d: Parse warning: %s form with empty body\n", pos.Filename(), pos.line, pos.column, formName) + fmt.Fprintf(os.Stderr, "%s:%d:%d: Parse warning: %s form with empty body\n", pos.Filename(), pos.startLine, pos.startColumn, formName) } default: panic(&ParseError{obj: obj, msg: formName + " requires a vector for its bindings"}) @@ -784,7 +784,7 @@ func macroexpand1(seq Seq, ctx *ParseContext) Object { } func reportNotAFunction(pos Position, name string) { - fmt.Fprintf(os.Stderr, "%s:%d:%d: Parse warning: %s is not a function\n", pos.Filename(), pos.line, pos.column, name) + fmt.Fprintf(os.Stderr, "%s:%d:%d: Parse warning: %s is not a function\n", pos.Filename(), pos.startLine, pos.startColumn, name) } func reportWrongArity(expr *FnExpr, isMacro bool, call *CallExpr, pos Position) { @@ -801,7 +801,7 @@ func reportWrongArity(expr *FnExpr, isMacro bool, call *CallExpr, pos Position) if v != nil && passedArgsCount >= len(v.args)-1 { return } - fmt.Fprintf(os.Stderr, "%s:%d:%d: Parse warning: Wrong number of args (%d) passed to %s\n", pos.Filename(), pos.line, pos.column, len(call.args), call.name) + fmt.Fprintf(os.Stderr, "%s:%d:%d: Parse warning: Wrong number of args (%d) passed to %s\n", pos.Filename(), pos.startLine, pos.startColumn, len(call.args), call.name) } func parseSetMacro(obj Object, ctx *ParseContext) Expr { diff --git a/core/read.go b/core/read.go index 186597224..3f187525e 100644 --- a/core/read.go +++ b/core/read.go @@ -20,6 +20,10 @@ type ( msg string } ReadFunc func(reader *Reader) Object + pos struct { + line int + column int + } ) const EOF = -1 @@ -37,6 +41,17 @@ func readStub(reader *Reader) Object { var DATA_READERS = map[*string]ReadFunc{} var NIL = Nil{} +var posStack = make([]pos, 0, 8) + +func pushPos(reader *Reader) { + posStack = append(posStack, pos{line: reader.line, column: reader.column}) +} + +func popPos() pos { + p := posStack[len(posStack)-1] + posStack = posStack[:len(posStack)-1] + return p +} func init() { DATA_READERS[MakeSymbol("inst").name] = readStub @@ -99,7 +114,14 @@ func MakeReadError(reader *Reader, msg string) ReadError { } func MakeReadObject(reader *Reader, obj Object) Object { - return obj.WithInfo(&ObjectInfo{Position: Position{line: reader.line, column: reader.column, filename: reader.filename}}) + p := popPos() + return obj.WithInfo(&ObjectInfo{Position: Position{ + startColumn: p.column, + startLine: p.line, + endLine: reader.line, + endColumn: reader.column, + filename: reader.filename, + }}) } func DeriveReadObject(base Object, obj Object) Object { @@ -748,13 +770,16 @@ func readDispatch(reader *Reader) Object { case '"': return readString(reader, true) case '\'': + popPos() nextObj := Read(reader) return DeriveReadObject(nextObj, NewListFrom(DeriveReadObject(nextObj, MakeSymbol("var")), nextObj)) case '^': + popPos() return readWithMeta(reader) case '{': return readSet(reader) case '(': + popPos() reader.Unget() ARGS = make(map[int]Symbol) fn := Read(reader) @@ -762,6 +787,7 @@ func readDispatch(reader *Reader) Object { ARGS = nil return res } + popPos() reader.Unget() return readTagged(reader) } @@ -780,6 +806,7 @@ func readWithMeta(reader *Reader) Object { func Read(reader *Reader) Object { eatWhitespace(reader) r := reader.Get() + pushPos(reader) switch { case r == '\\': return readCharacter(reader) @@ -807,12 +834,15 @@ func Read(reader *Reader) Object { case r == '/' && isDelimiter(reader.Peek()): return MakeReadObject(reader, MakeSymbol("/")) case r == '\'': + popPos() nextObj := Read(reader) return makeQuote(nextObj, MakeSymbol("quote")) case r == '@': + popPos() nextObj := Read(reader) return DeriveReadObject(nextObj, NewListFrom(DeriveReadObject(nextObj, MakeSymbol("deref")), nextObj)) case r == '~': + popPos() if reader.Peek() == '@' { reader.Get() nextObj := Read(reader) @@ -821,9 +851,11 @@ func Read(reader *Reader) Object { nextObj := Read(reader) return makeQuote(nextObj, MakeSymbol("unquote")) case r == '`': + popPos() nextObj := Read(reader) return makeSyntaxQuote(nextObj, make(map[*string]Symbol), reader) case r == '^': + popPos() return readWithMeta(reader) case r == '#': return readDispatch(reader) diff --git a/docs/core.html b/docs/core.html index 451030e72..af84f2be1 100644 --- a/docs/core.html +++ b/docs/core.html @@ -1045,7 +1045,7 @@

*

(* x y & more)

Returns the product of nums. (*) returns 1. Does not auto-promote
ints, will overflow. See also: *'

- source + source
  • *'

    @@ -1057,7 +1057,7 @@

    *'

    (*' x y & more)

    Returns the product of nums. (*) returns 1. Supports arbitrary precision.
    See also: *

    - source + source
  • *1

    @@ -1065,7 +1065,7 @@

    *1

    v1.0
    
       

    bound in a repl to the most recent value printed

    - source + source
  • *2

    @@ -1073,7 +1073,7 @@

    *2

    v1.0
    
       

    bound in a repl to the second most recent value printed

    - source + source
  • *3

    @@ -1081,7 +1081,7 @@

    *3

    v1.0
    
       

    bound in a repl to the third most recent value printed

    - source + source
  • *assert*

    @@ -1105,7 +1105,7 @@

    *e

    v1.0
    
       

    bound in a repl to the most recent exception caught by the repl

    - source + source
  • *err*

    @@ -1129,7 +1129,7 @@

    *flush-on-newline*

    v1.0
    
       

    When set to true, output will be flushed whenever a newline is printed.

    Defaults to true.

    - source + source
  • *in*

    @@ -1173,7 +1173,7 @@

    +

    (+ x y & more)

    Returns the sum of nums. (+) returns 0. Does not auto-promote
    ints, will overflow. See also: +'

    - source + source
  • +'

    @@ -1185,7 +1185,7 @@

    +'

    (+' x y & more)

    Returns the sum of nums. (+) returns 0. Supports arbitrary precision.
    See also: +

    - source + source
  • -

    @@ -1196,7 +1196,7 @@

    -

    (- x y & more)

    If no ys are supplied, returns the negation of x, else subtracts
    the ys from x and returns the result. Does not auto-promote
    ints, will overflow. See also: -'

    - source + source
  • -'

    @@ -1207,7 +1207,7 @@

    -'

    (-' x y & more)

    If no ys are supplied, returns the negation of x, else subtracts
    the ys from x and returns the result. Supports arbitrary precision.
    See also: -

    - source + source
  • ->

    @@ -1216,7 +1216,7 @@

    ->

    (-> x & forms)

    Threads the expr through the forms. Inserts x as the
    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.

    - source + source
  • ->>

    @@ -1225,7 +1225,7 @@

    ->>

    (->> x & forms)

    Threads the expr through the forms. Inserts x as the
    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.

    - source + source
  • /

    @@ -1236,7 +1236,7 @@

    /

    (/ x y & more)

    If no denominators are supplied, returns 1/numerator,
    else returns numerator divided by all of the denominators.

    - source + source
  • <

    @@ -1247,7 +1247,7 @@

    <

    (< x y & more)

    Returns non-nil if nums are in monotonically increasing order,
    otherwise false.

    - source + source
  • <=

    @@ -1258,7 +1258,7 @@

    <=

    (<= x y & more)

    Returns non-nil if nums are in monotonically non-decreasing order,
    otherwise false.

    - source + source
  • =

    @@ -1269,7 +1269,7 @@

    =

    (= x y & more)

    Equality. Returns true if x equals y, false if not. Works for nil, and compares
    numbers and collections in a type-independent manner. Immutable data
    structures define = as a value, not an identity,
    comparison.

    - source + source
  • ==

    @@ -1280,7 +1280,7 @@

    ==

    (== x y & more)

    Returns non-nil if nums all have the equivalent
    value (type-independent), otherwise false

    - source + source
  • >

    @@ -1291,7 +1291,7 @@

    >

    (> x y & more)

    Returns non-nil if nums are in monotonically decreasing order,
    otherwise false.

    - source + source
  • >=

    @@ -1302,7 +1302,7 @@

    >=

    (>= x y & more)

    Returns non-nil if nums are in monotonically non-increasing order,
    otherwise false.

    - source + source
  • alias

    @@ -1311,7 +1311,7 @@

    alias

    (alias alias namespace-sym)

    Add an alias in the current namespace to another
    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.

    - source + source
  • all-ns

    @@ -1320,7 +1320,7 @@

    all-ns

    (all-ns)

    Returns a sequence of all namespaces.

    - source + source
  • alter-meta!

    @@ -1329,7 +1329,7 @@

    alter-meta!

    (alter-meta! ref f & args)

    Atomically sets the metadata for a namespace/var/atom to be:

    (apply f its-current-meta args)

    f must be free of side-effects

    - source + source
  • and

    @@ -1340,7 +1340,7 @@

    and

    (and x & next)

    Evaluates exprs one at a time, from left to right. If a form
    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.

    - source + source
  • apply

    @@ -1353,7 +1353,7 @@

    apply

    (apply f a b c d & args)

    Applies fn f to the argument list formed by prepending intervening arguments to args.

    - source + source
  • array-map

    @@ -1362,7 +1362,7 @@

    array-map

    (array-map & keyvals)

    Constructs an array-map. If any keys are equal, they are handled as
    if by repeated uses of assoc.

    - source + source
  • as->

    @@ -1371,7 +1371,7 @@

    as->

    (as-> expr name & forms)

    Binds name to expr, evaluates the first form in the lexical context
    of that binding, then binds name to that result, repeating for each
    successive form, returning the result of the last form.

    - source + source
  • assert

    @@ -1381,7 +1381,7 @@

    assert

    (assert x message)

    Evaluates expr and throws an exception if it does not evaluate to
    logical true.

    - source + source
  • assoc

    @@ -1391,7 +1391,7 @@

    assoc

    (assoc map key val & kvs)

    `assoc[iate]. When applied to a map, returns a new map of the
    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).

    - source + source
  • assoc-in

    @@ -1400,7 +1400,7 @@

    assoc-in

    (assoc-in m [k & ks] v)

    Associates a value in a nested associative structure, where ks is a
    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.

    - source + source
  • associative?

    @@ -1409,7 +1409,7 @@

    associative?

    (associative? coll)

    Returns true if coll implements Associative

    - source + source
  • atom

    @@ -1418,7 +1418,7 @@

    atom

    (atom x & options)

    Creates and returns an Atom with an initial value of x and zero or
    more options (in any order):

    :meta metadata-map

    If metadata-map is supplied, it will become the metadata on the
    atom.

    - source + source
  • bigfloat

    @@ -1427,7 +1427,7 @@

    bigfloat

    (bigfloat x)

    Coerce to BigFloat

    - source + source
  • bigfloat?

    @@ -1436,7 +1436,7 @@

    bigfloat?

    (bigfloat? n)

    Returns true if n is a BigFloat

    - source + source
  • bigint

    @@ -1445,7 +1445,7 @@

    bigint

    (bigint x)

    Coerce to BigInt

    - source + source
  • binding

    @@ -1454,7 +1454,7 @@

    binding

    (binding bindings & body)

    binding => var-symbol init-expr

    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.

    - source + source
  • bit-and

    @@ -1464,7 +1464,7 @@

    bit-and

    (bit-and x y & more)

    Bitwise and

    - source + source
  • bit-and-not

    @@ -1474,7 +1474,7 @@

    bit-and-not

    (bit-and-not x y & more)

    Bitwise and with complement

    - source + source
  • bit-clear

    @@ -1483,7 +1483,7 @@

    bit-clear

    (bit-clear x n)

    Clear bit at index n

    - source + source
  • bit-flip

    @@ -1492,7 +1492,7 @@

    bit-flip

    (bit-flip x n)

    Flip bit at index n

    - source + source
  • bit-not

    @@ -1501,7 +1501,7 @@

    bit-not

    (bit-not x)

    Bitwise complement

    - source + source
  • bit-or

    @@ -1511,7 +1511,7 @@

    bit-or

    (bit-or x y & more)

    Bitwise or

    - source + source
  • bit-set

    @@ -1520,7 +1520,7 @@

    bit-set

    (bit-set x n)

    Set bit at index n

    - source + source
  • bit-shift-left

    @@ -1529,7 +1529,7 @@

    bit-shift-left

    (bit-shift-left x n)

    Bitwise shift left

    - source + source
  • bit-shift-right

    @@ -1538,7 +1538,7 @@

    bit-shift-right

    (bit-shift-right x n)

    Bitwise shift right

    - source + source
  • bit-test

    @@ -1547,7 +1547,7 @@

    bit-test

    (bit-test x n)

    Test bit at index n

    - source + source
  • bit-xor

    @@ -1557,7 +1557,7 @@

    bit-xor

    (bit-xor x y & more)

    Bitwise exclusive or

    - source + source
  • boolean

    @@ -1566,7 +1566,7 @@

    boolean

    (boolean x)

    Coerce to boolean

    - source + source
  • bound?

    @@ -1575,7 +1575,7 @@

    bound?

    (bound? & vars)

    Returns true if all of the vars provided as arguments have any bound value.
    Implies that deref'ing the provided vars will succeed. Returns true if no vars are provided.

    - source + source
  • butlast

    @@ -1584,7 +1584,7 @@

    butlast

    (butlast coll)

    Return a seq of all but the last item in coll, in linear time.

    - source + source
  • callable?

    @@ -1593,7 +1593,7 @@

    callable?

    (callable? x)

    Returns true if x implements Callable. Note that many data structures
    (e.g. sets and maps) implement Callable.

    - source + source
  • case

    @@ -1602,7 +1602,7 @@

    case

    (case expr & clauses)

    Takes an expression, and a set of clauses.

    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.

    - source + source
  • cast

    @@ -1611,7 +1611,7 @@

    cast

    (cast t x)

    Throws an error if x is not of a type t, else returns x.

    - source + source
  • char

    @@ -1620,7 +1620,7 @@

    char

    (char x)

    Coerce to char

    - source + source
  • char?

    @@ -1629,7 +1629,7 @@

    char?

    (char? x)

    Returns true if x is a Char

    - source + source
  • chunked-seq?

    @@ -1638,7 +1638,7 @@

    chunked-seq?

    (chunked-seq? s)

    Always returns false because chunked sequences are not supported

    - source + source
  • coll?

    @@ -1647,7 +1647,7 @@

    coll?

    (coll? x)

    Returns true if x implements Collection

    - source + source
  • comment

    @@ -1656,7 +1656,7 @@

    comment

    (comment & body)

    Ignores body, yields nil

    - source + source
  • comp

    @@ -1669,7 +1669,7 @@

    comp

    (comp f1 f2 f3 & fs)

    Takes a set of functions and returns a fn that is the composition
    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.

    - source + source
  • compare

    @@ -1678,7 +1678,7 @@

    compare

    (compare x y)

    Comparator. Returns a negative number, zero, or a positive number
    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

    - source + source
  • complement

    @@ -1687,7 +1687,7 @@

    complement

    (complement f)

    Takes a fn f and returns a fn that takes the same arguments as f,
    has the same effects, if any, and returns the opposite truth value.

    - source + source
  • concat

    @@ -1699,7 +1699,7 @@

    concat

    (concat x y & zs)

    Returns a lazy seq representing the concatenation of the elements in the supplied colls.

    - source + source
  • cond

    @@ -1708,7 +1708,7 @@

    cond

    (cond & clauses)

    Takes a set of test/expr pairs. It evaluates each test one at a
    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.

    - source + source
  • cond->

    @@ -1717,7 +1717,7 @@

    cond->

    (cond-> expr & clauses)

    Takes an expression and a set of test/form pairs. Threads expr (via ->)
    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.

    - source + source
  • cond->>

    @@ -1726,7 +1726,7 @@

    cond->>

    (cond->> expr & clauses)

    Takes an expression and a set of test/form pairs. Threads expr (via ->>)
    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.

    - source + source
  • condp

    @@ -1735,7 +1735,7 @@

    condp

    (condp pred expr & clauses)

    Takes a binary predicate, an expression, and a set of clauses.
    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.

    - source + source
  • conj

    @@ -1745,7 +1745,7 @@

    conj

    (conj coll x & xs)

    conj[oin]. Returns a new collection with the xs
    'added'. (conj nil item) returns (item). The 'addition' may
    happen at different 'places' depending on the concrete type.

    - source + source
  • cons

    @@ -1754,7 +1754,7 @@

    cons

    (cons x seq)

    Returns a new seq where x is the first element and seq is
    the rest.

    - source + source
  • constantly

    @@ -1763,7 +1763,7 @@

    constantly

    (constantly x)

    Returns a function that takes any number of arguments and returns x.

    - source + source
  • contains?

    @@ -1772,7 +1772,7 @@

    contains?

    (contains? coll key)

    Returns true if key is present in the given collection, otherwise
    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'.

    - source + source
  • count

    @@ -1781,7 +1781,7 @@

    count

    (count coll)

    Returns the number of items in the collection. (count nil) returns
    0. Also works on strings

    - source + source
  • counted?

    @@ -1790,7 +1790,7 @@

    counted?

    (counted? coll)

    Returns true if coll implements count in constant time

    - source + source
  • create-ns

    @@ -1799,7 +1799,7 @@

    create-ns

    (create-ns sym)

    Create a new namespace named by the symbol if one doesn't already
    exist, returns it or the already-existing namespace of the same
    name.

    - source + source
  • cycle

    @@ -1808,7 +1808,7 @@

    cycle

    (cycle coll)

    Returns a lazy (infinite!) sequence of repetitions of the items in coll.

    - source + source
  • dec

    @@ -1817,7 +1817,7 @@

    dec

    (dec x)

    Returns a number one less than num. Does not auto-promote
    ints, will overflow. See also: dec'

    - source + source
  • dec'

    @@ -1826,7 +1826,7 @@

    dec'

    (dec' x)

    Returns a number one less than num. Supports arbitrary precision.
    See also: dec

    - source + source
  • declare

    @@ -1835,7 +1835,7 @@

    declare

    (declare & names)

    defs the supplied var names with no bindings, useful for making forward declarations.

    - source + source
  • dedupe

    @@ -1844,7 +1844,7 @@

    dedupe

    (dedupe coll)

    Returns a lazy sequence removing consecutive duplicates in coll.

    - source + source
  • defmacro

    @@ -1854,7 +1854,7 @@

    defmacro

    (defmacro name doc-string? attr-map? ([params*] body) + attr-map?)

    Like defn, but the resulting function name is declared as a
    macro and will be used as a macro by the compiler when it is
    called.

    - source + source
  • defn

    @@ -1864,7 +1864,7 @@

    defn

    (defn name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?)

    Same as (def name (fn [params* ] exprs*)) or (def
    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.

    - source + source
  • defn-

    @@ -1873,7 +1873,7 @@

    defn-

    (defn- name & decls)

    same as defn, yielding non-public def

    - source + source
  • defonce

    @@ -1882,7 +1882,7 @@

    defonce

    (defonce name expr)

    defs name to have the value of the expr if the named var is not bound,
    else expr is unevaluated

    - source + source
  • delay

    @@ -1891,7 +1891,7 @@

    delay

    (delay & body)

    Takes a body of expressions and yields a Delay object that will
    invoke the body only the first time it is forced (with force or deref/@), and
    will cache the result and return it on all subsequent force
    calls. See also - realized?

    - source + source
  • delay?

    @@ -1900,7 +1900,7 @@

    delay?

    (delay? x)

    returns true if x is a Delay created with delay

    - source + source
  • denominator

    @@ -1909,7 +1909,7 @@

    denominator

    (denominator r)

    Returns the denominator part of a Ratio.

    - source + source
  • deref

    @@ -1918,7 +1918,7 @@

    deref

    (deref ref)

    Also reader macro: @var/@atom/@delay. When applied to a var or atom,
    returns its current state. When applied to a delay, forces
    it if not already forced.

    - source + source
  • disj

    @@ -1929,7 +1929,7 @@

    disj

    (disj set key & ks)

    disj[oin]. Returns a new set of the same (hashed/sorted) type, that
    does not contain key(s).

    - source + source
  • dissoc

    @@ -1940,7 +1940,7 @@

    dissoc

    (dissoc map key & ks)

    dissoc[iate]. Returns a new map of the same (hashed/sorted) type,
    that does not contain a mapping for key(s).

    - source + source
  • distinct

    @@ -1949,7 +1949,7 @@

    distinct

    (distinct coll)

    Returns a lazy sequence of the elements of coll with duplicates removed.

    - source + source
  • distinct?

    @@ -1960,7 +1960,7 @@

    distinct?

    (distinct? x y & more)

    Returns true if no two of the arguments are =

    - source + source
  • doall

    @@ -1970,7 +1970,7 @@

    doall

    (doall n coll)

    When lazy sequences are produced via functions that have side
    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.

    - source + source
  • dorun

    @@ -1980,7 +1980,7 @@

    dorun

    (dorun n coll)

    When lazy sequences are produced via functions that have side
    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.

    - source + source
  • doseq

    @@ -1989,7 +1989,7 @@

    doseq

    (doseq seq-exprs & body)

    Repeatedly executes body (presumably for side-effects) with
    bindings and filtering as provided by "for". Does not retain
    the head of the sequence. Returns nil.

    - source + source
  • dotimes

    @@ -1998,7 +1998,7 @@

    dotimes

    (dotimes bindings & body)

    bindings => name n

    Repeatedly executes body (presumably for side-effects) with name
    bound to integers from 0 through n-1.

    - source + source
  • double

    @@ -2007,7 +2007,7 @@

    double

    (double x)

    Coerce to double

    - source + source
  • drop

    @@ -2016,7 +2016,7 @@

    drop

    (drop n coll)

    Returns a lazy sequence of all but the first n items in coll.

    - source + source
  • drop-last

    @@ -2026,7 +2026,7 @@

    drop-last

    (drop-last n s)

    Return a lazy sequence of all but the last n (default 1) items in coll

    - source + source
  • drop-while

    @@ -2035,7 +2035,7 @@

    drop-while

    (drop-while pred coll)

    Returns a lazy sequence of the items in coll starting from the first
    item for which (pred item) returns logical false.

    - source + source
  • empty

    @@ -2044,7 +2044,7 @@

    empty

    (empty coll)

    Returns an empty collection of the same category as coll, or nil

    - source + source
  • empty?

    @@ -2053,7 +2053,7 @@

    empty?

    (empty? coll)

    Returns true if coll has no items - same as (not (seq coll)).
    Please use the idiom (seq x) rather than (not (empty? x))

    - source + source
  • eval

    @@ -2062,7 +2062,7 @@

    eval

    (eval form)

    Evaluates the form data structure (not text!) and returns the result.

    - source + source
  • even?

    @@ -2071,7 +2071,7 @@

    even?

    (even? n)

    Returns true if n is even, throws an exception if n is not an integer

    - source + source
  • every-pred

    @@ -2083,7 +2083,7 @@

    every-pred

    (every-pred p1 p2 p3 & ps)

    Takes a set of predicates and returns a function f that returns true if all of its
    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.

    - source + source
  • every?

    @@ -2092,7 +2092,7 @@

    every?

    (every? pred coll)

    Returns true if (pred x) is logical true for every x in coll, else
    false.

    - source + source
  • ex-data

    @@ -2101,7 +2101,7 @@

    ex-data

    (ex-data ex)

    Returns exception data (a map) if ex is an ExInfo.
    Otherwise returns nil.

    - source + source
  • ex-info

    @@ -2111,7 +2111,7 @@

    ex-info

    (ex-info msg map cause)

    Create an instance of ExInfo, an Error that carries a map of additional data.

    - source + source
  • false?

    @@ -2120,7 +2120,7 @@

    false?

    (false? x)

    Returns true if x is the value false, false otherwise.

    - source + source
  • ffirst

    @@ -2129,7 +2129,7 @@

    ffirst

    (ffirst x)

    Same as (first (first x))

    - source + source
  • filter

    @@ -2138,7 +2138,7 @@

    filter

    (filter pred coll)

    Returns a lazy sequence of the items in coll for which
    (pred item) returns true. pred must be free of side-effects.

    - source + source
  • filterv

    @@ -2147,7 +2147,7 @@

    filterv

    (filterv pred coll)

    Returns a vector of the items in coll for which
    (pred item) returns true. pred must be free of side-effects.

    - source + source
  • find

    @@ -2156,7 +2156,7 @@

    find

    (find map key)

    Returns the map entry for key, or nil if key not present.

    - source + source
  • find-ns

    @@ -2165,7 +2165,7 @@

    find-ns

    (find-ns sym)

    Returns the namespace named by the symbol or nil if it doesn't exist.

    - source + source
  • find-var

    @@ -2174,7 +2174,7 @@

    find-var

    (find-var sym)

    Returns the global var named by the namespace-qualified symbol, or
    nil if no var with that name.

    - source + source
  • first

    @@ -2183,7 +2183,7 @@

    first

    (first coll)

    Returns the first item in the collection. Calls seq on its
    argument. If coll is nil, returns nil.

    - source + source
  • flatten

    @@ -2192,7 +2192,7 @@

    flatten

    (flatten x)

    Takes any nested combination of sequential things (lists, vectors,
    etc.) and returns their contents as a single, flat sequence.
    (flatten nil) returns an empty sequence.

    - source + source
  • float?

    @@ -2201,7 +2201,7 @@

    float?

    (float? n)

    Returns true if n is a floating point number

    - source + source
  • flush

    @@ -2210,7 +2210,7 @@

    flush

    (flush)

    Flushes the output stream that is the current value of
    *out*

    - source + source
  • fn

    @@ -2220,7 +2220,7 @@

    fn

    (fn name? ([params*] exprs*) +)

    params => positional-params* , or positional-params* & next-param
    positional-param => binding-form
    next-param => binding-form
    name => symbol

    Defines a function

    - source + source
  • fn?

    @@ -2229,7 +2229,7 @@

    fn?

    (fn? x)

    Returns true if x is Fn, i.e. is an object created via fn.

    - source + source
  • fnext

    @@ -2238,7 +2238,7 @@

    fnext

    (fnext x)

    Same as (first (next x))

    - source + source
  • fnil

    @@ -2249,7 +2249,7 @@

    fnil

    (fnil f x y z)

    Takes a function f, and returns a function that calls f, replacing
    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.

    - source + source
  • for

    @@ -2258,7 +2258,7 @@

    for

    (for seq-exprs body-expr)

    List comprehension. Takes a vector of one or more
    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]))

    - source + source
  • force

    @@ -2267,7 +2267,7 @@

    force

    (force x)

    If x is a Delay, returns the (possibly cached) value of its expression, else returns x

    - source + source
  • format

    @@ -2276,7 +2276,7 @@

    format

    (format fmt & args)

    Formats a string using fmt.Sprintf

    - source + source
  • frequencies

    @@ -2285,7 +2285,7 @@

    frequencies

    (frequencies coll)

    Returns a map from distinct items in coll to the number of times
    they appear.

    - source + source
  • gensym

    @@ -2295,7 +2295,7 @@

    gensym

    (gensym prefix-string)

    Returns a new symbol with a unique name. If a prefix string is
    supplied, the name is prefix# where # is some unique number. If
    prefix is not supplied, the prefix is 'G__'.

    - source + source
  • get

    @@ -2305,7 +2305,7 @@

    get

    (get map key not-found)

    Returns the value mapped to key, not-found or nil if key not present.

    - source + source
  • get-in

    @@ -2315,7 +2315,7 @@

    get-in

    (get-in m ks not-found)

    Returns the value in a nested associative structure,
    where ks is a sequence of keys. Returns nil if the key
    is not present, or the not-found value if supplied.

    - source + source
  • group-by

    @@ -2324,7 +2324,7 @@

    group-by

    (group-by f coll)

    Returns a map of the elements of coll keyed by the result of
    f on each element. The value at each key will be a vector of the
    corresponding elements, in the order they appeared in coll.

    - source + source
  • hash

    @@ -2333,7 +2333,7 @@

    hash

    (hash x)

    Returns the hash code of its argument.

    - source + source
  • hash-map

    @@ -2342,7 +2342,7 @@

    hash-map

    (hash-map & keyvals)

    keyval => key val
    Returns a new hash map with supplied mappings. If any keys are
    equal, they are handled as if by repeated uses of assoc.

    - source + source
  • hash-set

    @@ -2351,7 +2351,7 @@

    hash-set

    (hash-set & keys)

    Returns a new hash set with supplied keys. Any equal keys are
    handled as if by repeated uses of conj.

    - source + source
  • identical?

    @@ -2360,7 +2360,7 @@

    identical?

    (identical? x y)

    Tests if 2 arguments are the same object

    - source + source
  • identity

    @@ -2369,7 +2369,7 @@

    identity

    (identity x)

    Returns its argument.

    - source + source
  • if-let

    @@ -2379,7 +2379,7 @@

    if-let

    (if-let bindings then else & oldform)

    bindings => binding-form test

    If test is true, evaluates then with binding-form bound to the value of
    test, if not, yields else

    - source + source
  • if-not

    @@ -2389,7 +2389,7 @@

    if-not

    (if-not test then else)

    Evaluates test. If logical false, evaluates and returns then expr,
    otherwise else expr, if supplied, else nil.

    - source + source
  • if-some

    @@ -2399,7 +2399,7 @@

    if-some

    (if-some bindings then else & oldform)

    bindings => binding-form test

    If test is not nil, evaluates then with binding-form bound to the
    value of test, if not, yields else

    - source + source
  • in-ns

    @@ -2408,7 +2408,7 @@

    in-ns

    (in-ns name)

    Sets *ns* to the namespace named by the symbol, creating it if needed.

    - source + source
  • inc

    @@ -2417,7 +2417,7 @@

    inc

    (inc x)

    Returns a number one greater than num. Does not auto-promote
    ints, will overflow. See also: inc'

    - source + source
  • inc'

    @@ -2426,7 +2426,7 @@

    inc'

    (inc' x)

    Returns a number one greater than num. Supports arbitrary precision.
    See also: inc

    - source + source
  • instance?

    @@ -2435,7 +2435,7 @@

    instance?

    (instance? c x)

    Evaluates x and tests if it is an instance of type
    c. Returns true or false

    - source + source
  • int

    @@ -2444,7 +2444,7 @@

    int

    (int x)

    Coerce to int

    - source + source
  • integer?

    @@ -2453,7 +2453,7 @@

    integer?

    (integer? n)

    Returns true if n is an integer

    - source + source
  • interleave

    @@ -2465,7 +2465,7 @@

    interleave

    (interleave c1 c2 & colls)

    Returns a lazy seq of the first item in each coll, then the second etc.

    - source + source
  • intern

    @@ -2475,7 +2475,7 @@

    intern

    (intern ns name val)

    Finds or creates a var named by the symbol name in the namespace
    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.

    - source + source
  • interpose

    @@ -2484,7 +2484,7 @@

    interpose

    (interpose sep coll)

    Returns a lazy seq of the elements of coll separated by sep.
    Returns a stateful transducer when no collection is provided.

    - source + source
  • into

    @@ -2493,7 +2493,7 @@

    into

    (into to from)

    Returns a new coll consisting of to-coll with all of the items of
    from-coll conjoined.

    - source + source
  • iterate

    @@ -2502,7 +2502,7 @@

    iterate

    (iterate f x)

    Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects

    - source + source
  • juxt

    @@ -2514,7 +2514,7 @@

    juxt

    (juxt f g h & fs)

    Takes a set of functions and returns a fn that is the juxtaposition
    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)]

    - source + source
  • keep

    @@ -2523,7 +2523,7 @@

    keep

    (keep f coll)

    Returns a lazy sequence of the non-nil results of (f item). Note,
    this means false return values will be included. f must be free of
    side-effects.

    - source + source
  • keep-indexed

    @@ -2532,7 +2532,7 @@

    keep-indexed

    (keep-indexed f coll)

    Returns a lazy sequence of the non-nil results of (f index item). Note,
    this means false return values will be included. f must be free of
    side-effects.

    - source + source
  • key

    @@ -2541,7 +2541,7 @@

    key

    (key e)

    Returns the key of the map entry.

    - source + source
  • keys

    @@ -2550,7 +2550,7 @@

    keys

    (keys map)

    Returns a sequence of the map's keys, in the same order as (seq map).

    - source + source
  • keyword

    @@ -2560,7 +2560,7 @@

    keyword

    (keyword ns name)

    Returns a Keyword with the given namespace and name. Do not use :
    in the keyword strings, it will be added automatically.

    - source + source
  • keyword?

    @@ -2569,7 +2569,7 @@

    keyword?

    (keyword? x)

    Return true if x is a Keyword

    - source + source
  • last

    @@ -2578,7 +2578,7 @@

    last

    (last coll)

    Return the last item in coll, in linear time.

    - source + source
  • lazy-cat

    @@ -2587,7 +2587,7 @@

    lazy-cat

    (lazy-cat & colls)

    Expands to code which yields a lazy sequence of the concatenation
    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))

    - source + source
  • lazy-seq

    @@ -2596,7 +2596,7 @@

    lazy-seq

    (lazy-seq & body)

    Takes a body of expressions that returns an ISeq or nil, and yields
    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?

    - source + source
  • let

    @@ -2605,7 +2605,7 @@

    let

    (let [bindings*] exprs*)

    binding => binding-form init-expr

    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.

    - source + source
  • list

    @@ -2614,7 +2614,7 @@

    list

    (list & items)

    Creates a new list containing the items.

    - source + source
  • list*

    @@ -2627,7 +2627,7 @@

    list*

    (list* a b c d & more)

    Creates a new list containing the items prepended to the rest, the
    last of which will be treated as a sequence.

    - source + source
  • list?

    @@ -2636,7 +2636,7 @@

    list?

    (list? x)

    Returns true if x is a List

    - source + source
  • load

    @@ -2645,7 +2645,7 @@

    load

    (load & libs)

    Loads code from libs.

    - source + source
  • load-file

    @@ -2654,7 +2654,7 @@

    load-file

    (load-file f)

    Loads code from file f

    - source + source
  • load-string

    @@ -2663,7 +2663,7 @@

    load-string

    (load-string s)

    Sequentially read and evaluate the set of forms contained in the
    string

    - source + source
  • loaded-libs

    @@ -2672,7 +2672,7 @@

    loaded-libs

    (loaded-libs)

    Returns a sorted set of symbols naming the currently loaded libs

    - source + source
  • loop

    @@ -2681,7 +2681,7 @@

    loop

    (loop [bindings*] exprs*)

    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. Acts as a recur target.

    - source + source
  • macroexpand

    @@ -2690,7 +2690,7 @@

    macroexpand

    (macroexpand form)

    Repeatedly calls macroexpand-1 on form until it no longer
    represents a macro form, then returns it. Note neither
    macroexpand-1 nor macroexpand expand macros in subforms.

    - source + source
  • macroexpand-1

    @@ -2699,7 +2699,7 @@

    macroexpand-1

    (macroexpand-1 form)

    If form represents a macro form, returns its expansion, else returns form.

    - source + source
  • map

    @@ -2711,7 +2711,7 @@

    map

    (map f c1 c2 c3 & colls)

    Returns a lazy sequence consisting of the result of applying f to the
    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.

    - source + source
  • map-indexed

    @@ -2720,7 +2720,7 @@

    map-indexed

    (map-indexed f coll)

    Returns a lazy sequence consisting of the result of applying f to 0
    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.

    - source + source
  • map?

    @@ -2729,7 +2729,7 @@

    map?

    (map? x)

    Returns true if x is a map

    - source + source
  • mapcat

    @@ -2738,7 +2738,7 @@

    mapcat

    (mapcat f & colls)

    Returns the result of applying concat to the result of applying map
    to f and colls. Thus function f should return a collection.

    - source + source
  • mapv

    @@ -2750,7 +2750,7 @@

    mapv

    (mapv f c1 c2 c3 & colls)

    Returns a vector consisting of the result of applying f to the
    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.

    - source + source
  • max

    @@ -2761,7 +2761,7 @@

    max

    (max x y & more)

    Returns the greatest of the nums.

    - source + source
  • max-key

    @@ -2772,7 +2772,7 @@

    max-key

    (max-key k x y & more)

    Returns the x for which (k x), a number, is greatest.

    - source + source
  • memoize

    @@ -2781,7 +2781,7 @@

    memoize

    (memoize f)

    Returns a memoized version of a referentially transparent function. The
    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.

    - source + source
  • merge

    @@ -2790,7 +2790,7 @@

    merge

    (merge & maps)

    Returns a map that consists of the rest of the maps conj-ed onto
    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.

    - source + source
  • merge-with

    @@ -2799,7 +2799,7 @@

    merge-with

    (merge-with f & maps)

    Returns a map that consists of the rest of the maps conj-ed onto
    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).

    - source + source
  • meta

    @@ -2808,7 +2808,7 @@

    meta

    (meta obj)

    Returns the metadata of obj, returns nil if there is no metadata.

    - source + source
  • min

    @@ -2819,7 +2819,7 @@

    min

    (min x y & more)

    Returns the least of the nums.

    - source + source
  • min-key

    @@ -2830,7 +2830,7 @@

    min-key

    (min-key k x y & more)

    Returns the x for which (k x), a number, is least.

    - source + source
  • mod

    @@ -2839,7 +2839,7 @@

    mod

    (mod num div)

    Modulus of num and div. Truncates toward negative infinity.

    - source + source
  • name

    @@ -2848,7 +2848,7 @@

    name

    (name x)

    Returns the name String of a string, symbol or keyword.

    - source + source
  • namespace

    @@ -2857,7 +2857,7 @@

    namespace

    (namespace x)

    Returns the namespace String of a symbol or keyword, or nil if not present.

    - source + source
  • neg?

    @@ -2866,7 +2866,7 @@

    neg?

    (neg? x)

    Returns true if num is less than zero, else false

    - source + source
  • newline

    @@ -2875,7 +2875,7 @@

    newline

    (newline)

    Writes a platform-specific newline to *out*

    - source + source
  • next

    @@ -2884,7 +2884,7 @@

    next

    (next coll)

    Returns a seq of the items after the first. Calls seq on its
    argument. If there are no more items, returns nil.

    - source + source
  • nfirst

    @@ -2893,7 +2893,7 @@

    nfirst

    (nfirst x)

    Same as (next (first x))

    - source + source
  • nil?

    @@ -2902,7 +2902,7 @@

    nil?

    (nil? x)

    Returns true if x is nil, false otherwise.

    - source + source
  • nnext

    @@ -2911,7 +2911,7 @@

    nnext

    (nnext x)

    Same as (next (next x))

    - source + source
  • not

    @@ -2920,7 +2920,7 @@

    not

    (not x)

    Returns true if x is logical false, false otherwise.

    - source + source
  • not-any?

    @@ -2929,7 +2929,7 @@

    not-any?

    (not-any? pred coll)

    Returns false if (pred x) is logical true for any x in coll,
    else true.

    - source + source
  • not-empty

    @@ -2938,7 +2938,7 @@

    not-empty

    (not-empty coll)

    If coll is empty, returns nil, else coll

    - source + source
  • not-every?

    @@ -2947,7 +2947,7 @@

    not-every?

    (not-every? pred coll)

    Returns false if (pred x) is logical true for every x in
    coll, else true.

    - source + source
  • not=

    @@ -2958,7 +2958,7 @@

    not=

    (not= x y & more)

    Same as (not (= obj1 obj2))

    - source + source
  • ns

    @@ -2967,7 +2967,7 @@

    ns

    (ns name docstring? attr-map? references*)

    Sets *ns* to the namespace named by name (unevaluated), creating it
    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]))

    - source + source
  • ns-aliases

    @@ -2976,7 +2976,7 @@

    ns-aliases

    (ns-aliases ns)

    Returns a map of the aliases for the namespace.

    - source + source
  • ns-interns

    @@ -2985,7 +2985,7 @@

    ns-interns

    (ns-interns ns)

    Returns a map of the intern mappings for the namespace.

    - source + source
  • ns-map

    @@ -2994,7 +2994,7 @@

    ns-map

    (ns-map ns)

    Returns a map of all the mappings for the namespace.

    - source + source
  • ns-name

    @@ -3003,7 +3003,7 @@

    ns-name

    (ns-name ns)

    Returns the name of the namespace, a symbol.

    - source + source
  • ns-publics

    @@ -3012,7 +3012,7 @@

    ns-publics

    (ns-publics ns)

    Returns a map of the public intern mappings for the namespace.

    - source + source
  • ns-refers

    @@ -3021,7 +3021,7 @@

    ns-refers

    (ns-refers ns)

    Returns a map of the refer mappings for the namespace.

    - source + source
  • ns-resolve

    @@ -3031,7 +3031,7 @@

    ns-resolve

    (ns-resolve ns env sym)

    Returns the var or type to which a symbol will be resolved in the
    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.

    - source + source
  • ns-unalias

    @@ -3040,7 +3040,7 @@

    ns-unalias

    (ns-unalias ns sym)

    Removes the alias for the symbol from the namespace.

    - source + source
  • ns-unmap

    @@ -3049,7 +3049,7 @@

    ns-unmap

    (ns-unmap ns sym)

    Removes the mappings for the symbol from the namespace.

    - source + source
  • nth

    @@ -3059,7 +3059,7 @@

    nth

    (nth coll index not-found)

    Returns the value at the index. get returns nil if index out of
    bounds, nth throws an exception unless not-found is supplied. nth
    also works, in O(n) time, for strings and sequences.

    - source + source
  • nthnext

    @@ -3068,7 +3068,7 @@

    nthnext

    (nthnext coll n)

    Returns the nth next of coll, (seq coll) when n is 0.

    - source + source
  • nthrest

    @@ -3077,7 +3077,7 @@

    nthrest

    (nthrest coll n)

    Returns the nth rest of coll, coll when n is 0.

    - source + source
  • num

    @@ -3086,7 +3086,7 @@

    num

    (num x)

    Coerce to Number

    - source + source
  • number?

    @@ -3095,7 +3095,7 @@

    number?

    (number? x)

    Returns true if x is a Number

    - source + source
  • numerator

    @@ -3104,7 +3104,7 @@

    numerator

    (numerator r)

    Returns the numerator part of a Ratio.

    - source + source
  • odd?

    @@ -3113,7 +3113,7 @@

    odd?

    (odd? n)

    Returns true if n is odd, throws an exception if n is not an integer

    - source + source
  • or

    @@ -3124,7 +3124,7 @@

    or

    (or x & next)

    Evaluates exprs one at a time, from left to right. If a form
    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.

    - source + source
  • partial

    @@ -3137,7 +3137,7 @@

    partial

    (partial f arg1 arg2 arg3 & more)

    Takes a function f and fewer than the normal arguments to f, and
    returns a fn that takes a variable number of additional args. When
    called, the returned function calls f with args + additional args.

    - source + source
  • partition

    @@ -3148,7 +3148,7 @@

    partition

    (partition n step pad coll)

    Returns a lazy sequence of lists of n items each, at offsets step
    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.

    - source + source
  • partition-all

    @@ -3158,7 +3158,7 @@

    partition-all

    (partition-all n step coll)

    Returns a lazy sequence of lists like partition, but may include
    partitions with fewer than n items at the end.

    - source + source
  • partition-by

    @@ -3167,7 +3167,7 @@

    partition-by

    (partition-by f coll)

    Applies f to each value in coll, splitting it each time f returns a
    new value. Returns a lazy seq of partitions.

    - source + source
  • peek

    @@ -3176,7 +3176,7 @@

    peek

    (peek coll)

    For a list, same as first, for a vector, same as, but much
    more efficient than, last. If the collection is empty, returns nil.

    - source + source
  • pop

    @@ -3185,7 +3185,7 @@

    pop

    (pop coll)

    For a list, returns a new list without the first
    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.

    - source + source
  • pos?

    @@ -3194,7 +3194,7 @@

    pos?

    (pos? x)

    Returns true if num is greater than zero, else false

    - source + source
  • pr

    @@ -3203,7 +3203,7 @@

    pr

    (pr & args)

    Prints the object(s) to the output stream that is the current value
    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

    - source + source
  • pr-str

    @@ -3212,7 +3212,7 @@

    pr-str

    (pr-str & xs)

    pr to a string, returning it

    - source + source
  • print

    @@ -3221,7 +3221,7 @@

    print

    (print & more)

    Prints the object(s) to the output stream that is the current value
    of *out*. print and println produce output for human consumption.

    - source + source
  • @@ -3230,7 +3230,7 @@
    (print-str & xs)

    print to a string, returning it

    - source + source
  • printf

    @@ -3239,7 +3239,7 @@

    printf

    (printf fmt & args)

    Prints formatted output, as per format

    - source + source
  • println

    @@ -3248,7 +3248,7 @@

    println

    (println & more)

    Same as print followed by (newline)

    - source + source
  • println-str

    @@ -3257,7 +3257,7 @@

    println-str

    (println-str & xs)

    println to a string, returning it

    - source + source
  • prn

    @@ -3266,7 +3266,7 @@

    prn

    (prn & more)

    Same as pr followed by (newline). Observes *flush-on-newline*

    - source + source
  • prn-str

    @@ -3275,7 +3275,7 @@

    prn-str

    (prn-str & xs)

    prn to a string, returning it

    - source + source
  • quot

    @@ -3284,7 +3284,7 @@

    quot

    (quot num div)

    quot[ient] of dividing numerator by denominator.

    - source + source
  • rand

    @@ -3294,7 +3294,7 @@

    rand

    (rand n)

    Returns a random floating point number between 0 (inclusive) and
    n (default 1) (exclusive).

    - source + source
  • rand-int

    @@ -3303,7 +3303,7 @@

    rand-int

    (rand-int n)

    Returns a random integer between 0 (inclusive) and n (exclusive).

    - source + source
  • rand-nth

    @@ -3312,7 +3312,7 @@

    rand-nth

    (rand-nth coll)

    Return a random element of the (sequential) collection. Will have
    the same performance characteristics as nth for the given
    collection.

    - source + source
  • random-sample

    @@ -3321,7 +3321,7 @@

    random-sample

    (random-sample prob coll)

    Returns items from coll with random probability of prob (0.0 -
    1.0).

    - source + source
  • range

    @@ -3333,7 +3333,7 @@

    range

    (range start end step)

    Returns a lazy seq of nums from start (inclusive) to end
    (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.

    - source + source
  • ratio?

    @@ -3342,7 +3342,7 @@

    ratio?

    (ratio? n)

    Returns true if n is a Ratio

    - source + source
  • rational?

    @@ -3351,7 +3351,7 @@

    rational?

    (rational? n)

    Returns true if n is a rational number

    - source + source
  • re-find

    @@ -3360,7 +3360,7 @@

    re-find

    (re-find re s)

    Returns the leftmost regex match, if any, of string to pattern.

    - source + source
  • re-matches

    @@ -3369,7 +3369,7 @@

    re-matches

    (re-matches re s)

    Returns the match, if any, of string to pattern.

    - source + source
  • re-pattern

    @@ -3378,7 +3378,7 @@

    re-pattern

    (re-pattern s)

    Returns an instance of Regex

    - source + source
  • re-seq

    @@ -3387,7 +3387,7 @@

    re-seq

    (re-seq re s)

    Returns a sequence of successive matches of pattern in string

    - source + source
  • read

    @@ -3397,7 +3397,7 @@

    read

    (read reader)

    Reads the next object from reader (defaults to *in*)

    - source + source
  • read-line

    @@ -3406,7 +3406,7 @@

    read-line

    (read-line)

    Reads the next line from *in*.

    - source + source
  • read-string

    @@ -3415,7 +3415,7 @@

    read-string

    (read-string s)

    Reads one object from the string s.

    - source + source
  • realized?

    @@ -3424,7 +3424,7 @@

    realized?

    (realized? x)

    Returns true if a value has been produced for a delay or lazy sequence.

    - source + source
  • reduce

    @@ -3434,7 +3434,7 @@

    reduce

    (reduce f val coll)

    f should be a function of 2 arguments. If val is not supplied,
    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.

    - source + source
  • reduce-kv

    @@ -3443,7 +3443,7 @@

    reduce-kv

    (reduce-kv f init coll)

    Reduces an associative collection. f should be a function of 3
    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.

    - source + source
  • reductions

    @@ -3453,7 +3453,7 @@

    reductions

    (reductions f init coll)

    Returns a lazy seq of the intermediate values of the reduction (as
    per reduce) of coll by f, starting with init.

    - source + source
  • refer

    @@ -3462,7 +3462,7 @@

    refer

    (refer ns-sym & filters)

    refers to all public vars of ns, subject to filters.
    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.

    - source + source
  • rem

    @@ -3471,7 +3471,7 @@

    rem

    (rem num div)

    remainder of dividing numerator by denominator.

    - source + source
  • remove

    @@ -3480,7 +3480,7 @@

    remove

    (remove pred coll)

    Returns a lazy sequence of the items in coll for which
    (pred item) returns false. pred must be free of side-effects.

    - source + source
  • remove-ns

    @@ -3489,7 +3489,7 @@

    remove-ns

    (remove-ns sym)

    Removes the namespace named by the symbol. Use with caution.
    Cannot be used to remove the clojure namespace.

    - source + source
  • repeat

    @@ -3499,7 +3499,7 @@

    repeat

    (repeat n x)

    Returns a lazy (infinite!, or length n if supplied) sequence of xs.

    - source + source
  • repeatedly

    @@ -3509,7 +3509,7 @@

    repeatedly

    (repeatedly n f)

    Takes a function of no args, presumably with side effects, and
    returns an infinite (or length n if supplied) lazy sequence of calls
    to it

    - source + source
  • replace

    @@ -3518,7 +3518,7 @@

    replace

    (replace smap coll)

    Given a map of replacement pairs and a vector/collection, returns a
    vector/seq with any elements = a key in smap replaced with the
    corresponding val in smap.

    - source + source
  • require

    @@ -3527,7 +3527,7 @@

    require

    (require & args)

    Loads libs, skipping any that are already loaded. Each argument is
    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 Java package that share its name. A lib's
    name also locates its root directory within classpath using Java's
    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
    /x/y/, and its root resource is /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]))

    - source + source
  • reset!

    @@ -3536,7 +3536,7 @@

    reset!

    (reset! atom newval)

    Sets the value of atom to newval without regard for the
    current value. Returns newval.

    - source + source
  • reset-meta!

    @@ -3545,7 +3545,7 @@

    reset-meta!

    (reset-meta! ref metadata-map)

    Atomically resets the metadata for a namespace/var/atom

    - source + source
  • resolve

    @@ -3555,7 +3555,7 @@

    resolve

    (resolve env sym)

    Same as (ns-resolve *ns* sym) or (ns-resolve *ns* env sym)

    - source + source
  • rest

    @@ -3564,7 +3564,7 @@

    rest

    (rest coll)

    Returns a possibly empty seq of the items after the first. Calls seq on its
    argument.

    - source + source
  • reverse

    @@ -3573,7 +3573,7 @@

    reverse

    (reverse coll)

    Returns a seq of the items in coll in reverse order. Not lazy.

    - source + source
  • reversible?

    @@ -3582,7 +3582,7 @@

    reversible?

    (reversible? coll)

    Returns true if coll implements Reversible

    - source + source
  • rseq

    @@ -3591,7 +3591,7 @@

    rseq

    (rseq rev)

    Returns, in constant time, a seq of the items in rev (which
    can be a vector or sorted-map), in reverse order. If rev is empty returns nil.

    - source + source
  • run!

    @@ -3600,7 +3600,7 @@

    run!

    (run! proc coll)

    Runs the supplied procedure (via reduce), for purposes of side
    effects, on successive items in the collection. Returns nil

    - source + source
  • second

    @@ -3609,7 +3609,7 @@

    second

    (second x)

    Same as (first (next x))

    - source + source
  • select-keys

    @@ -3618,7 +3618,7 @@

    select-keys

    (select-keys map keyseq)

    Returns a map containing only those entries in map whose key is in keys

    - source + source
  • seq

    @@ -3627,7 +3627,7 @@

    seq

    (seq coll)

    Returns a seq on the collection. If the collection is
    empty, returns nil. (seq nil) returns nil.

    - source + source
  • seq?

    @@ -3636,7 +3636,7 @@

    seq?

    (seq? x)

    Returns true if x is a sequence

    - source + source
  • sequence

    @@ -3645,7 +3645,7 @@

    sequence

    (sequence coll)

    Coerces coll to a (possibly empty) sequence, if it is not already
    one. Will not force a lazy seq. (sequence nil) yields ()

    - source + source
  • sequential?

    @@ -3654,7 +3654,7 @@

    sequential?

    (sequential? coll)

    Returns true if coll implements Sequential

    - source + source
  • set

    @@ -3663,7 +3663,7 @@

    set

    (set coll)

    Returns a set of the distinct elements of coll.

    - source + source
  • set?

    @@ -3672,7 +3672,7 @@

    set?

    (set? x)

    Returns true if x implements Set

    - source + source
  • shuffle

    @@ -3681,7 +3681,7 @@

    shuffle

    (shuffle coll)

    Return a random permutation of coll

    - source + source
  • slurp

    @@ -3690,7 +3690,7 @@

    slurp

    (slurp f)

    Opens file f and reads all its contents, returning a string.

    - source + source
  • some

    @@ -3699,7 +3699,7 @@

    some

    (some pred coll)

    Returns the first logical true value of (pred x) for any x in coll,
    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)

    - source + source
  • some->

    @@ -3708,7 +3708,7 @@

    some->

    (some-> expr & forms)

    When expr is not nil, threads it into the first form (via ->),
    and when that result is not nil, through the next etc

    - source + source
  • some->>

    @@ -3717,7 +3717,7 @@

    some->>

    (some->> expr & forms)

    When expr is not nil, threads it into the first form (via ->>),
    and when that result is not nil, through the next etc

    - source + source
  • some-fn

    @@ -3729,7 +3729,7 @@

    some-fn

    (some-fn p1 p2 p3 & ps)

    Takes a set of predicates and returns a function f that returns the first logical true value
    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.

    - source + source
  • some?

    @@ -3738,7 +3738,7 @@

    some?

    (some? x)

    Returns true if x is not nil, false otherwise.

    - source + source
  • sort

    @@ -3748,7 +3748,7 @@

    sort

    (sort comp coll)

    Returns a sorted sequence of the items in coll. If no comparator is
    supplied, uses compare.

    - source + source
  • sort-by

    @@ -3758,7 +3758,7 @@

    sort-by

    (sort-by keyfn comp coll)

    Returns a sorted sequence of the items in coll, where the sort
    order is determined by comparing (keyfn item). If no comparator is
    supplied, uses compare.

    - source + source
  • special-symbol?

    @@ -3767,7 +3767,7 @@

    special-symbol?

    (special-symbol? s)

    Returns true if s names a special form

    - source + source
  • spit

    @@ -3776,7 +3776,7 @@

    spit

    (spit f content)

    Opposite of slurp. Opens file f, writes content, then
    closes f.

    - source + source
  • split-at

    @@ -3785,7 +3785,7 @@

    split-at

    (split-at n coll)

    Returns a vector of [(take n coll) (drop n coll)]

    - source + source
  • split-with

    @@ -3794,7 +3794,7 @@

    split-with

    (split-with pred coll)

    Returns a vector of [(take-while pred coll) (drop-while pred coll)]

    - source + source
  • str

    @@ -3803,7 +3803,7 @@

    str

    (str & xs)

    With no args, returns the empty string. With one arg x, returns
    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.

    - source + source
  • string?

    @@ -3812,7 +3812,7 @@

    string?

    (string? x)

    Returns true if x is a String

    - source + source
  • subs

    @@ -3822,7 +3822,7 @@

    subs

    (subs s start end)

    Returns the substring of s beginning at start inclusive, and ending
    at end (defaults to length of string), exclusive.

    - source + source
  • subvec

    @@ -3832,7 +3832,7 @@

    subvec

    (subvec v start end)

    Returns a persistent vector of the items in vector from
    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.

    - source + source
  • swap!

    @@ -3841,7 +3841,7 @@

    swap!

    (swap! atom f & args)

    Atomically swaps the value of atom to be:
    (apply f current-value-of-atom args).
    Returns the value that was swapped in.

    - source + source
  • symbol

    @@ -3851,7 +3851,7 @@

    symbol

    (symbol ns name)

    Returns a Symbol with the given namespace and name.

    - source + source
  • symbol?

    @@ -3860,7 +3860,7 @@

    symbol?

    (symbol? x)

    Return true if x is a Symbol

    - source + source
  • take

    @@ -3869,7 +3869,7 @@

    take

    (take n coll)

    Returns a lazy sequence of the first n items in coll, or all items if
    there are fewer than n.

    - source + source
  • take-last

    @@ -3878,7 +3878,7 @@

    take-last

    (take-last n coll)

    Returns a seq of the last n items in coll. Depending on the type
    of coll may be no better than linear time. For vectors, see also subvec.

    - source + source
  • take-nth

    @@ -3887,7 +3887,7 @@

    take-nth

    (take-nth n coll)

    Returns a lazy seq of every nth item in coll.

    - source + source
  • take-while

    @@ -3896,7 +3896,7 @@

    take-while

    (take-while pred coll)

    Returns a lazy sequence of successive items from coll while
    (pred item) returns true. pred must be free of side-effects.

    - source + source
  • test

    @@ -3905,7 +3905,7 @@

    test

    (test v)

    test [v] finds fn at key :test in var metadata and calls it,
    presuming failure will throw exception

    - source + source
  • the-ns

    @@ -3914,7 +3914,7 @@

    the-ns

    (the-ns x)

    If passed a namespace, returns it. Else, when passed a symbol,
    returns the namespace named by it, throwing an exception if not
    found.

    - source + source
  • time

    @@ -3923,7 +3923,7 @@

    time

    (time expr)

    Evaluates expr and prints the time it took. Returns the value of expr.

    - source + source
  • trampoline

    @@ -3933,7 +3933,7 @@

    trampoline

    (trampoline f & args)

    trampoline can be used to convert algorithms requiring mutual
    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.

    - source + source
  • tree-seq

    @@ -3942,7 +3942,7 @@

    tree-seq

    (tree-seq branch? children root)

    Returns a lazy sequence of the nodes in a tree, via a depth-first walk.
    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.

    - source + source
  • true?

    @@ -3951,7 +3951,7 @@

    true?

    (true? x)

    Returns true if x is the value true, false otherwise.

    - source + source
  • type

    @@ -3960,7 +3960,7 @@

    type

    (type x)

    Returns the :type metadata of x, or its Type if none

    - source + source
  • unsigned-bit-shift-right

    @@ -3969,7 +3969,7 @@

    unsigned-bit-shift-right

    (unsigned-bit-shift-right x n)

    Bitwise shift right, without sign-extension.

    - source + source
  • update

    @@ -3982,7 +3982,7 @@

    update

    (update m k f x y z & more)

    'Updates' a value in an associative structure, where k is a
    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.

    - source + source
  • update-in

    @@ -3991,7 +3991,7 @@

    update-in

    (update-in m [k & ks] f & args)

    'Updates' a value in a nested associative structure, where ks is a
    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.

    - source + source
  • use

    @@ -4000,7 +4000,7 @@

    use

    (use & args)

    Like 'require, but also refers to each lib's namespace using
    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 core/refer.

    - source + source
  • val

    @@ -4009,7 +4009,7 @@

    val

    (val e)

    Returns the value in the map entry.

    - source + source
  • vals

    @@ -4018,7 +4018,7 @@

    vals

    (vals map)

    Returns a sequence of the map's values, in the same order as (seq map).

    - source + source
  • var-get

    @@ -4027,7 +4027,7 @@

    var-get

    (var-get x)

    Gets the value in the var object

    - source + source
  • var-set

    @@ -4036,7 +4036,7 @@

    var-set

    (var-set x val)

    Sets the value in the var object to val.

    - source + source
  • var?

    @@ -4045,7 +4045,7 @@

    var?

    (var? v)

    Returns true if v is of type Var

    - source + source
  • vary-meta

    @@ -4054,7 +4054,7 @@

    vary-meta

    (vary-meta obj f & args)

    Returns an object of the same type and value as obj, with
    (apply f (meta obj) args) as its metadata.

    - source + source
  • vec

    @@ -4063,7 +4063,7 @@

    vec

    (vec coll)

    Creates a new vector containing the contents of coll.

    - source + source
  • vector

    @@ -4072,7 +4072,7 @@

    vector

    (vector & args)

    Creates a new vector containing the args.

    - source + source
  • vector?

    @@ -4081,7 +4081,7 @@

    vector?

    (vector? x)

    Returns true if x is a vector

    - source + source
  • when

    @@ -4090,7 +4090,7 @@

    when

    (when test & body)

    Evaluates test. If logical true, evaluates body in an implicit do.

    - source + source
  • when-first

    @@ -4099,7 +4099,7 @@

    when-first

    (when-first bindings & body)

    bindings => x xs

    Roughly the same as (when (seq xs) (let [x (first xs)] body)) but xs is evaluated only once

    - source + source
  • when-let

    @@ -4108,7 +4108,7 @@

    when-let

    (when-let bindings & body)

    bindings => binding-form test

    When test is true, evaluates body with binding-form bound to the value of test

    - source + source
  • when-not

    @@ -4117,7 +4117,7 @@

    when-not

    (when-not test & body)

    Evaluates test. If logical false, evaluates body in an implicit do.

    - source + source
  • when-some

    @@ -4126,7 +4126,7 @@

    when-some

    (when-some bindings & body)

    bindings => binding-form test

    When test is not nil, evaluates body with binding-form bound to the
    value of test

    - source + source
  • while

    @@ -4135,7 +4135,7 @@

    while

    (while test & body)

    Repeatedly executes body while test expression is true. Presumes
    some side-effect will cause test to become false/nil. Returns nil

    - source + source
  • with-bindings

    @@ -4144,7 +4144,7 @@

    with-bindings

    (with-bindings binding-map & body)

    Takes a map of Var/value pairs. Sets the vars to the corresponding values.
    Then executes body. Resets the vars back to the original
    values after body was evaluated. Returns the value of body.

    - source + source
  • with-bindings*

    @@ -4153,7 +4153,7 @@

    with-bindings*

    (with-bindings* binding-map f & args)

    Takes a map of Var/value pairs. Sets the vars to the corresponding values.
    Then calls f with the supplied arguments. Resets the vars back to the original
    values after f returned. Returns whatever f returns.

    - source + source
  • with-in-str

    @@ -4162,7 +4162,7 @@

    with-in-str

    (with-in-str s & body)

    Evaluates body in a context in which *in* is bound to a fresh
    Buffer initialized with the string s.

    - source + source
  • with-meta

    @@ -4171,7 +4171,7 @@

    with-meta

    (with-meta obj m)

    Returns an object of the same type and value as obj, with
    map m as its metadata.

    - source + source
  • with-out-str

    @@ -4180,7 +4180,7 @@

    with-out-str

    (with-out-str & body)

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

    - source + source
  • with-redefs

    @@ -4189,7 +4189,7 @@

    with-redefs

    (with-redefs bindings & body)

    The same as binding

    - source + source
  • with-redefs-fn

    @@ -4198,7 +4198,7 @@

    with-redefs-fn

    (with-redefs-fn binding-map f & args)

    The same as with-bindings*

    - source + source
  • xml-seq

    @@ -4207,7 +4207,7 @@

    xml-seq

    (xml-seq root)

    A tree seq on the xml elements as per xml/parse

    - source + source
  • zero?

    @@ -4216,7 +4216,7 @@

    zero?

    (zero? x)

    Returns true if num is zero, else false

    - source + source
  • zipmap

    @@ -4225,7 +4225,7 @@

    zipmap

    (zipmap keys vals)

    Returns a map with the keys mapped to the corresponding vals.

    - source + source