- * — Returns the product of its arguments.
(*) → integer
(* value) → value
(* value other more*) → value
- + — Returns the sum of its arguments.
(+) → integer
(+ value) → value
(+ value other more*) → value
- - — With one argument, returns its negation.
With additional arguments, subtracts each from the running result in order.
At least one argument is required. Numeric operands follow the arithmetic rules
above; temporal operands use the combinations in the table.
Integer overflow and non-finite floating-point results are errors, including
when negating the minimum integer.
Unary subtraction also negates durations; UTC timestamps cannot be negated.
(- value more*) → value
- / — Returns
n divided by d and each additional divisor in more, or the reciprocal of n when called with one argument.(/ n) → float
(/ value divisor more*) → value
- < — Returns whether the arguments are strictly increasing.
(< first second more*) → boolean
- <= — Returns whether the arguments are nondecreasing.
(<= first second more*) → boolean
- = — Returns
true if all supplied values are equal, otherwise false.(= x) → boolean
(= x y) → boolean
(= x y more*) → boolean
- > — Returns whether the arguments are strictly decreasing.
(> first second more*) → boolean
- >= — Returns whether the arguments are nonincreasing.
(>= first second more*) → boolean
- and — Evaluates forms once each, from left to right, and returns the first falsey
value without evaluating later forms; an
#err value is falsey, so and returns it. If every form is truthy, returns the
last value. With no forms, returns true.(and forms*) → value
- apply — Calls a function value with the elements of a list as its arguments.
(apply function arguments) → value
- boolean — Returns
false if value is null or false, otherwise true.(boolean value) → boolean
- boolean? — Returns
true if b is either true or false, otherwise false.(boolean? b) → boolean
- collections/copy — Returns a copy of
value that changes to either leave the other unchanged.
Copies every list and map reachable from value. A list or map reached more than once is copied once, so collections shared within value stay shared within the copy, and cycles stay cycles.
With the mode shallow, copies only the top-level list or map; its members are shared.
Other values do not change and are returned as they are.(collections/copy value) → value
(collections/copy value shallow) → value
- collections/update — Replaces the value at
path in root with the result of calling f on that value and args, in place, and returns the same root collection.
Stores the result as put does, including container creation and list growth.
A missing entry supplies null to f.(collections/update root path f args*) → collection
- compare — Returns
-1, 0, or 1 when first sorts before, ties with, or sorts after second, using sort ordering.(compare first second) → integer
- comparison/identical? — Returns
true if its operands refer to the same value, otherwise false.
Errors raised at the same place with the same tags and message may be the
same value.
- comparison/not= — Returns the negation of the corresponding equality call. This means that not all
arguments are equal, rather than requiring every pair to differ. One argument
returns
false; no arguments is an error. Equality retains its matching-kind
checks and stops comparing after the first unequal pair.(comparison/not= value more*) → boolean
- cond — Chooses among pairs of tests and result expressions.
(cond test result ...)
- const? — Returns
true if v is a constant reference, such as the quoted form
`:name, otherwise false. A local and a constant with the same name are
not equal.(const? v) → boolean
- contains? — Returns
true if path selects a value in root, including null or false, otherwise false.(contains? root path) → boolean
- count — Returns the number of list elements, pointer segments, map members, or Unicode string code points.
For
null, returns zero.(count collection) → integer
- distinct — Returns a fresh list retaining the first occurrence of each distinct typed
value. Collections compare structurally, with map member order ignored.
Kinds remain distinct: integer
1 and float 1.0 are separate values.
Functions compare by identity. Positive and negative floating zero compare equal.(distinct list) → list
- do — Evaluates the
expr forms in order and returns the last result.(do expr*) → value
- empty? — Returns whether
count is zero. Lists, pointers, maps, strings, and null are accepted.(empty? collection) → boolean
- error? — Returns
true if value is an error and false otherwise. Errors can be
passed as arguments without losing their tags.(error? value) → boolean
- export — Names the top-level locals that a library file provides. When a runtime
loads the file under a namespace, as
!load lib/shapes s does in the
Epsilon REPL, each named local becomes the constant :s/name, with the
value the local has when the file has run. The other locals of the file
stay private, and the file's functions read them, not the locals of the
code that calls them.(export name*) → list
- false? — Returns
true if value is the boolean false, otherwise false.(false? value) → boolean
- first — Returns the first element or pointer segment, or
null when empty.(first list) → value
- float — Converts an integer to a float, returns a float unchanged, or parses a signed
decimal string with an optional decimal point and exponent. Integer conversion
can lose precision; for example, integer
9007199254740993 converts to
9007199254740992.0. Whitespace, hexadecimal notation, NaN, and infinity are
rejected. Overflow is an error; underflow to zero is permitted. Booleans, null,
and nominal types such as links are rejected.(float value) → float
- float? — Returns
true if n is a floating-point number, otherwise false.(float? n) → boolean
- fn — Compiles a function literal into a closure.
(fn name? doc-or-meta? [params*] body*) → function
(fn name? doc-or-meta? ([params*] body*)+) → function
- fn/comp — Returns a function composing its inputs right to left, passing all call arguments to the rightmost function and each result to the next.
With no inputs, returns
fn/identity.
With one, returns f.(fn/comp) → function
(fn/comp f) → function
(fn/comp f g functions*) → function
- fn/complement — Returns a function that calls
f with its arguments and negates the result as a boolean.(fn/complement f) → function
- fn/constantly — Returns a function that ignores its arguments and returns
value.(fn/constantly value) → function
- fn/fnull — Returns a function that calls
f, replacing null in its first three argument positions with the supplied defaults x, y, and z.
Preserves false and does not supply missing arguments.(fn/fnull f x) → function
(fn/fnull f x y) → function
(fn/fnull f x y z) → function
- fn/identity — Returns
value unchanged.(fn/identity value) → value
- fn/juxt — Returns a function that applies
f and functions to the same arguments and returns their results in order as a list.(fn/juxt f functions*) → function
- fn/partial — Returns a function that calls
f with args followed by its call-time arguments.
With no fixed arguments, returns f.(fn/partial f args*) → function
- fn? — Returns
true if f is a function, otherwise false.(fn? f) → boolean
- for — Evaluates a body for each combination of collection values and returns a list of the results.
(for [name collection ...] body)
- format — Returns a string by substituting
args into the conversion specifications in template.(format template args*) → string
- from-pairs — Returns a fresh map from
[key value] pairs in list.
Later duplicate keys win.(from-pairs list) → map
- get — Returns the value selected by
path in root, or default if an entry is missing.
Without default, a missing entry returns null.
A selected value of null or false is returned unchanged, not replaced by default.
get does not modify root or copy the selected value.(get root path) → value
(get root path default) → value
- hash/digest — Returns a
#hash of value under algorithm, a name from this table:(hash/digest algorithm value) → hash
- if — Selects a branch according to the truthiness of a test.
(if test then)
(if test then else)
- int — Returns an integer unchanged, truncates a float toward zero, or parses a signed
decimal string exactly. String input accepts an optional ASCII sign followed
by ASCII decimal digits, including leading zeros. Whitespace, decimal points,
exponents, and hexadecimal notation are rejected. Values outside signed 64-bit
range are errors. Booleans, null, and nominal types such as links are rejected.
(int value) → integer
- int? — Returns
true if n is an integer, otherwise false.
A link scalar is not an integer.(int? n) → boolean
- jsonptr — Converts RFC 6901 text to a pointer. The empty string gives the root pointer;
a nonempty string must start with
/ and contain only valid ~0 and ~1
escapes. Invalid text gives #err <invalid value>; a non-string gives
#err <mismatch type>.(jsonptr text) → pointer
- jsonptr? — Returns
true for a pointer and false for other values. A pointer is not a
list, even though the list functions accept it.(jsonptr? value) → boolean
- keys — Returns the map's string keys in ascending Unicode order.
(keys map) → list
- let — Introduces local bindings and evaluates a body in their scope.
(let [bindings*] exprs*)
- list? — Returns
true if xs is a list, otherwise false.(list? xs) → boolean
- lists/any? — Returns
true at the first truthy predicate result without visiting later
elements. Returns false for an empty list.(lists/any? predicate list) → boolean
- lists/append — Appends
values to list in place as individual elements and returns the same list.
Values are stored without copying. With no additional values, leaves list unchanged.
list must be a list, not null or a pointer.(lists/append list values*) → list
- lists/concat — Returns a fresh list containing the elements of each input list, in order.
With no inputs, returns an empty list.
(lists/concat lists*) → list
- lists/drop — Returns a fresh list excluding the first
n elements of list.(lists/drop n list) → list
- lists/drop-while — Returns
list from the first element for which predicate is falsey, skipping the preceding elements.(lists/drop-while predicate list) → list
- lists/every? — Returns
false at the first falsey predicate result without visiting later
elements. Returns true for an empty list.(lists/every? predicate list) → boolean
- lists/filter — Calls
predicate on each element, from left to right, and returns the elements
whose results are truthy. Retains their input order.(lists/filter predicate list) → list
- lists/find-first — Returns the first element of
list for which predicate is truthy, or default if none matches.
The default is null.(lists/find-first predicate list) → value
(lists/find-first predicate list default) → value
- lists/flatten — Returns a list of the non-list elements in
list, recursively expanding nested lists in order.
Empty lists contribute no elements.
Non-list elements, including maps, strings, and null, are kept unchanged.
list must be a list, otherwise produces #err <mismatch type>.
Missing or extra arguments produce #err <arity mismatch>.(lists/flatten list) → list
- lists/frequencies — Counts each string in the input list and returns a map from strings to integer
counts. Non-string elements are errors; integer
1 is never coerced to string "1".(lists/frequencies strings) → map
- lists/group-by — Calls
function on each element, from left to right. Each result must be a
string and becomes a map key. Each map value is the list of input elements
with that key, preserving their input order. Non-string keys are errors.(lists/group-by function list) → map
- lists/interleave — Returns a fresh list taking one element from each input list in turn, stopping at the shortest list.
Returns
[] with no inputs and a shallow copy with one.(lists/interleave) → list
(lists/interleave list) → list
(lists/interleave list1 list2) → list
(lists/interleave list1 list2 lists*) → list
- lists/interpose — Returns a fresh list with
separator between adjacent elements of list.(lists/interpose separator list) → list
- lists/keep — Returns the results of applying
f to each element of list, excluding null but preserving false and input order.(lists/keep f list) → list
- lists/last — Returns the last element, or
null for an empty list.(lists/last list) → value
- lists/mapcat — Applies
f to corresponding elements of list and any additional lists, then concatenates the result lists one level deep.
Stops at the shortest input list.(lists/mapcat f list lists*) → list
- lists/nth — Returns the element at the nonnegative, zero-based integer
index.
An out-of-range index returns default if supplied; otherwise it is an error.
A negative index is an error even when a default is supplied.(lists/nth list index default?) → value
- lists/partition — Returns groups of up to
n elements from list, starting step elements apart and including short trailing groups.
step defaults to n.(lists/partition n list) → list
(lists/partition n step list) → list
- lists/partition-by — Returns consecutive groups from
list, starting a new group whenever f returns a different value.(lists/partition-by f list) → list
- lists/range — Returns integers from
start up to, but excluding, end, incrementing by
step. The defaults are zero for start and one for step. A negative step
produces a descending range. A zero step is an error. All arguments must be integers.(lists/range end) → list
(lists/range start end step?) → list
- lists/repeat — Returns a list containing
value the specified number of times. count must
be a nonnegative integer. Values are reused rather than deep copied.(lists/repeat count value) → list
- lists/reverse — Reverses
list in place and returns the same list, without copying the elements.
list must be a list, not null or a pointer.(lists/reverse list) → list
- lists/second — Returns the second element of
list, or null if list has fewer than two elements.(lists/second list) → value
- lists/slice — Returns a fresh list from
start up to, but excluding, end.
Indexes are nonnegative, zero-based integers. An omitted end means the list's
length. Indexes beyond the length are clamped, and an end before the start
produces an empty list.(lists/slice list start end?) → list
- lists/some — Returns the first truthy result of applying
f to elements of list, without visiting later elements, or null if none matches.(lists/some f list) → value
- lists/sort-by — Sorts
list in place, stably, by the keys returned by f, and returns the same list.
The list's order changes only after key extraction and all comparisons succeed.
list must be a list, not null or a pointer.
Calls f once per element, from left to right, before making comparisons.
The key function must be an ordinary function and must not change the input list or its elements.
Uses sort ordering, or the supplied comparator applied to the keys.
Equal keys keep their input order. Elements are shared without copying.
Key-function errors stop processing and are returned.(lists/sort-by f list) → list
(lists/sort-by f comparator list) → list
- lists/take — Returns a fresh list of the first
n elements of list, or all elements if fewer are available.(lists/take n list) → list
- lists/take-while — Returns the leading elements of
list for which predicate is truthy, stopping at the first falsey result.(lists/take-while predicate list) → list
- local — Defines a top-level local: a binding that the later top-level forms of the
same file, or of the same REPL session, read as
.name.(local name value?) → local reference
- local? — Returns
true if v is a local reference, such as the quoted form
`.name, otherwise false.(local? v) → boolean
- map — Returns a list of the results of applying
f to corresponding elements of xs and any additional lists.(map f xs) → list
(map f xs lists*) → list
- map? — Returns
true if m is a map, otherwise false.(map? m) → boolean
- maps/select-keys — Returns a fresh map containing the literal top-level keys in
keys that are present in map.(maps/select-keys map keys) → map
- maps/zipmap — Returns a fresh map pairing string
keys with values, stopping at the shorter list.
Later duplicate keys win.(maps/zipmap keys values) → map
- math/abs — Returns the absolute value, preserving integer or float kind. The absolute
value of the minimum integer overflows and is an error.
Durations are also accepted and return a duration; the minimum tick
duration likewise overflows. UTC timestamps are rejected.
(math/abs value) → value
- math/acos — Returns the arc cosine of
n in radians, in the range from zero to pi.(math/acos n) → float
- math/acosh — Returns the nonnegative inverse hyperbolic cosine of
n.(math/acosh n) → float
- math/asin — Returns the arc sine of
n in radians, in the range from negative pi/2 to pi/2.(math/asin n) → float
- math/asinh — Returns the inverse hyperbolic sine of
n.(math/asinh n) → float
- math/atan — Returns the arc tangent of
n in radians, in the range from negative pi/2 to pi/2.(math/atan n) → float
- math/atan2 — Returns the angle of the point
(x, y) in radians, in the range from negative pi to pi, using both signs to select the quadrant.(math/atan2 y x) → float
- math/atanh — Returns the inverse hyperbolic tangent of
n.(math/atanh n) → float
- math/cbrt — Returns the real cube root of
n, with the same sign as n.(math/cbrt n) → float
- math/ceil — Returns the least integral-valued float greater than or equal to
n after conversion to a float.(math/ceil n) → float
- math/clamp — Returns
value limited to the inclusive interval from low through high.
All three arguments must have the same numeric or temporal kind, and low
must not exceed high.(math/clamp value low high) → value
- math/copy-sign — Returns the absolute value of
magnitude with the sign of sign, including the sign of floating-point zero.(math/copy-sign magnitude sign) → float
- math/cos — Returns the cosine of
angle in radians.(math/cos angle) → float
- math/cosh — Returns the hyperbolic cosine of
n.(math/cosh n) → float
- math/degrees — Returns the angle
radians converted to degrees.(math/degrees radians) → float
- math/even? — Returns
true if integer n is even, otherwise false.(math/even? n) → boolean
- math/exp — Returns e raised to
n.(math/exp n) → float
- math/exp2 — Returns two raised to
n.(math/exp2 n) → float
- math/expm1 — Returns e raised to
n minus one, computed without the loss of precision from subtracting one from math/exp's rounded result near zero.(math/expm1 n) → float
- math/floor — Returns the greatest integral-valued float less than or equal to
n after conversion to a float.(math/floor n) → float
- math/floor-div — Returns the integer quotient of
n divided by d, rounded toward negative infinity.(math/floor-div n d) → integer
- math/floor-mod — Returns the integer remainder of
n divided by d using a quotient rounded toward negative infinity.(math/floor-mod n d) → integer
- math/hypot — Returns the square root of
x*x + y*y without intermediate overflow or underflow.(math/hypot x y) → float
- math/inverse-lerp — Returns the fraction locating
value between start and end, without
clamping. Equal endpoints are an error.(math/inverse-lerp start end value) → float
- math/lerp — Returns
start + (end - start) * fraction as a float. The fraction is not
clamped, so values outside zero through one extrapolate beyond the endpoints.(math/lerp start end fraction) → float
- math/log — Returns the natural logarithm of
n, or its logarithm in the supplied base.
When base is supplied, both numbers must have the same type. The base must be
positive and cannot be one.(math/log n) → float
(math/log n base) → float
- math/log10 — Returns the base-ten logarithm of
n.(math/log10 n) → float
- math/log1p — Returns the natural logarithm of one plus
n, computed without the loss of precision from rounding 1 + n near zero.(math/log1p n) → float
- math/log2 — Returns the base-two logarithm of
n.(math/log2 n) → float
- math/max — Returns the greatest argument. Requires at least one argument, and all arguments
must have the same numeric or temporal kind. Integer and temporal comparisons
retain full 64-bit precision.
(math/max value more*) → value
- math/min — Returns the least argument. Requires at least one argument, and all arguments
must have the same numeric or temporal kind. Integer and temporal comparisons
retain full 64-bit precision.
(math/min value more*) → value
- math/odd? — Returns
true if integer n is odd, otherwise false.(math/odd? n) → boolean
- math/pow — Returns
base raised to exponent.(math/pow base exponent) → float
- math/radians — Returns the angle
degrees converted to radians.(math/radians degrees) → float
- math/remap — Maps
value from the input interval to the output interval, without clamping.
Equal input endpoints are an error. Reversed intervals are accepted.(math/remap input-start input-end output-start output-end value) → float
- math/rint — Returns the integral-valued float nearest to
n after conversion to a float, choosing the even integer in halfway cases.(math/rint n) → float
- math/round — Returns the integer nearest to
n, rounding halfway cases away from zero.(math/round n) → integer
- math/sign — Returns integer
-1, 0, or 1 according to the argument's sign.(math/sign number) → integer
- math/signum — Returns
-1.0 for negative n, 1.0 for positive n, or zero with n's sign for zero.(math/signum n) → float
- math/sin — Returns the sine of
angle in radians.(math/sin angle) → float
- math/sinh — Returns the hyperbolic sine of
n.(math/sinh n) → float
- math/sqrt — Returns the square root of
n.(math/sqrt n) → float
- math/tan — Returns the tangent of
angle in radians.(math/tan angle) → float
- math/tanh — Returns the hyperbolic tangent of
n.(math/tanh n) → float
- math/trunc — Returns
n converted to a float with its fractional part discarded, rounding toward zero.(math/trunc n) → float
- math/zero? — Returns
true if n is zero, otherwise false.(math/zero? n) → boolean
- not — Returns
true if value is null or false, otherwise false.(not value) → boolean
- null? — Returns
true if x is null, otherwise false.(null? x) → boolean
- number? — Returns
true if n is an integer or a float, otherwise false.
A link scalar is not a number.(number? n) → boolean
- or — Evaluates forms once each, from left to right, and returns the first truthy
value without evaluating later forms. If every form is falsey, returns the
last value. With no forms, returns
null.(or forms*) → value
- pairs — Returns
[key value] pairs in the same ascending key order used by keys.(pairs map) → list
- patch — Applies JSON Merge Patch member semantics to
map in place and returns the same map.
All arguments must be maps, checked before any patch is applied.
With no changes maps, returns map unchanged.(patch map changes*) → map
- put — Stores
value at path in root in place and returns the same root collection.
Inserts or replaces a map entry, or replaces an existing list element.
A list index equal to its length appends one element. Larger indices are errors.
Values replace rather than merge, and null is stored rather than deleted.
Creates maps, never lists, for missing or null intermediate values.
Integer path segments require an existing list.(put root path value) → collection
- quasiquote — Constructs data while evaluating unquotes at the matching nesting depth.
List-element splices insert the elements of their evaluated list.
See Quotation forms for prefix syntax and encoding.
#quasiquote form
- quote — Returns the enclosed form as data without evaluating it.
References, invocations, and collection contents retain their form representation.
See Quotation forms for prefix syntax and encoding.
#quote form
- random/choose — Returns one item of
list, each with the same chance. An empty list or
null produces #err <invalid value>.(random/choose generator list) → value
- random/float — Returns a float
x with lo < x < hi=. Both bounds are floats. The function
takes the top 53 bits of the next output as u in [0, 1), and maps it to lo +
u * (hi - lo). When hi - lo is too large for a float, it uses lo * (1 - u) +
hi * u. A result that rounds up to hi is drawn again.(random/float generator lo hi) → float
- random/int — Returns an integer
x with lo < x < hi=, uniform over the range. The range
can span all 64-bit integers. Integers use Lemire's multiply-and-reject method,
so no value is more likely than another.(random/int generator lo hi) → integer
- random/seeded — Returns a new generator for the integer
seed. Every integer is a seed,
negative ones included.(random/seeded seed) → generator
- random/shuffle — Returns a new list with the items of
list in a uniform random order, and
leaves list unchanged. The order comes from a Fisher–Yates shuffle that
swaps each position i, from the last down to the second, with a position
from 0 to i. null shuffles to [].(random/shuffle generator list) → list
- reduce — Starts with
initial and calls function with the accumulator and each list
element, in list order. Each call's result becomes the next accumulator.
Returns the final accumulator. An empty list or null returns initial
without calling the function. The first argument must be an ordinary function
value and the third must be a list, pointer, or null. Errors stop reduction immediately: a call
that returns an #err value ends the reduction, and that value is the result.(reduce function initial list) → value
- regex/find — Returns the next match from
matcher, or the first match of re in string s.
Returns null if there is no match.(regex/find matcher [opts]) → string, list, map, or null
(regex/find re s [opts]) → string, list, map, or null
- regex/find-all — Returns an eager list of successive, non-overlapping matches of
re in string s.
Each item uses the capture format of regex/groups.
Returns an empty list if there are no matches.
After an empty match, the search first tries a nonempty match at the same
position; if there is none, it advances by one code point.(regex/find-all re s [opts]) → list
- regex/groups — Returns the current match from
matcher without advancing it.
Without options and with no capture groups, returns the matched string.
Otherwise, returns a list containing the full match followed by each capture in group-number order.
An unmatched group is null.
Without a current match, produces an error.(regex/groups matcher [opts]) → string, list, or map
- regex/matcher — Returns a new mutable matcher for
re in string s, for use with regex/find and regex/groups.
A matcher is an opaque value owned by its runtime. It can be passed between
evaluations in that runtime, but it cannot be serialized or used in another runtime.
The current match is cleared when a search reaches the end without a match.(regex/matcher re s) → matcher
- regex/matches — Returns the match if
re matches the entire string s, otherwise null.
Results use the capture format of regex/groups.(regex/matches re s [opts]) → string, list, map, or null
- regex/pattern — Returns a compiled pattern for string
s, or s unchanged if it is already a pattern.
Invalid patterns produce an error.(regex/pattern s) → pattern
- regex/quote-replacement — Returns string
replacement escaped for literal use with regex/replace or regex/replace-first.(regex/quote-replacement replacement) → string
- regex/replace — Returns string
s with all non-overlapping matches of re replaced by replacement.(regex/replace s re replacement [opts]) → string
- regex/replace-first — Returns string
s with the first match of re replaced by replacement.
Uses the replacement rules of regex/replace.(regex/replace-first s re replacement [opts]) → string
- regex/split — Returns a list of parts of string
s split on matches of re.
The integer limit defaults to zero.
A positive limit permits at most that many parts, with the unsplit suffix in the last part.
Zero omits trailing empty strings.
A negative limit preserves them.
A zero-width match at the start of s does not create a leading empty part.
If no split occurs, the result contains s as its only part.(regex/split s re) → list
(regex/split s re limit) → list
- rem — Returns the remainder with the sign of the dividend. Two integers produce an
exact integer remainder; otherwise the result is a float. A zero divisor is an
error. The minimum integer divided by
-1 has remainder zero.(rem dividend divisor) → number
- remove — Removes the entry selected by
path from root in place and returns the same root collection.
Removes a map member or a list element, shifting later list elements left.
Empty parent collections are not removed.
A missing key, out-of-range nonnegative index, or missing or null intermediate value leaves root unchanged.
No containers are created.(remove root path) → collection
- rest — Returns a fresh sequence without the first element. A pointer produces a
pointer; an empty list produces
[] and an empty pointer produces the root pointer.(rest list) → list
- sort — Sorts
list in place, stably, and returns the same list, without copying its elements.
The list's order changes only after all comparisons succeed.
list must be a list, not null or a pointer.
By default, sorts in ascending order and requires all elements to have the same kind.
Orderable kinds are null, boolean, integer, float, string, link, UTC, duration,
SHA-256, and pointer. Pointer segments compare lexicographically, with an
index before a key; a shorter prefix sorts before its extension. Integers and
nominal integer payloads compare exactly. Strings
compare by Unicode code point order, booleans put false before true, and
SHA-256 values compare their bytes. Null values tie.(sort list) → list
(sort comparator list) → list
- str — Converts zero or more
values to strings and concatenates them in argument order.
It inserts no spaces or other separators.
With no arguments, returns the empty string.(str values*) → string
- string? — Returns
true if s is a string, otherwise false.(string? s) → boolean
- strings/blank? — Returns
true if s is null, empty, or contains only whitespace, otherwise false.(strings/blank? s) → boolean
- strings/case — Converts
value with one case selector or a list of selectors. A list applies
the conversions from left to right. An empty list returns the input unchanged.
The selector and input must be strings. Unknown selectors produce an error.(strings/case case value) → string
(strings/case cases value) → string
- strings/ends-with? — Returns whether the string ends with the literal
suffix.
Every string ends with the empty string.(strings/ends-with? string suffix) → boolean
- strings/escape — Escapes text for the specified mode. With only a mode, returns a unary function
that escapes its argument, for use as a template's
escape option. The function
prints and hashes as its call, such as (strings/escape html-text), and
renders a template argument before escaping it.(strings/escape mode text) → string
(strings/escape mode) → function
- strings/from-code-points — Returns the string formed by the Unicode scalar values in the list
points, in order.(strings/from-code-points points) → string
- strings/humanize — Formats an integer, float, duration, or UTC value as readable text. Options are
a map with string keys. Unknown options and options irrelevant to the value's
kind are errors.
(strings/humanize value options?) → string
- strings/includes? — Returns whether the string contains the literal
search.
Every string includes the empty string.(strings/includes? string search) → boolean
- strings/index-of — Returns the first index of the string
value in s at or after start, or null if not found.(strings/index-of s value) → integer or null
(strings/index-of s value start) → integer or null
- strings/join — Joins a list of strings with
separator between consecutive elements.
An empty list produces the empty string. Elements and the separator must be strings.(strings/join strings separator) → string
- strings/last-index-of — Returns the last index of the string
value in s at or before start, or null if not found.(strings/last-index-of s value) → integer or null
(strings/last-index-of s value start) → integer or null
- strings/normalize — Returns
s normalized to the Unicode normalization form, defaulting to NFC.(strings/normalize s) → string
(strings/normalize s form) → string
- strings/replace — Replaces non-overlapping literal occurrences of
search, from left to right.
An empty search inserts replacement before, between, and after the input's
Unicode code points: (strings/replace ab "" x) returns xaxbx.(strings/replace string search replacement) → string
- strings/replace-first — Returns
s with the first occurrence of match replaced by replacement.(strings/replace-first s match replacement) → string
- strings/split — Splits at each literal occurrence of
separator, preserving empty fields.
An empty separator splits into Unicode code points; splitting an empty string
with an empty separator returns a list containing the empty string.(strings/split string separator) → list
(strings/split string separator limit) → list
- strings/split-lines — Returns the lines of
s separated by LF or CRLF, without their line endings.(strings/split-lines s) → list
- strings/starts-with? — Returns whether the string begins with the literal
prefix.
Every string starts with the empty string.(strings/starts-with? string prefix) → boolean
- strings/substring — Returns the code points from
start up to, but excluding, end.
Without end, returns the rest of the string. Both indices must be integers
between zero and the string length, and start must not exceed end. Other
indices produce #err <bounds index>.(strings/substring string start) → string
(strings/substring string start end) → string
- strings/trim — Returns
s with whitespace or text removed from the ends selected by opts.(strings/trim opts s) → string
(strings/trim opts text s) → string
- strings/unescape — Decodes text for the same modes as
strings/escape. With only a mode, returns
a unary decoding function that prints and hashes as its call, such as
(strings/unescape url-query-value). Invalid JSON Pointer, URL percent, CSV, and quoted
string escapes produce #err <invalid value>, as do URL percent escapes whose
bytes are not UTF-8, since strings are always Unicode text. HTML decoding recognizes
semicolon-terminated named and numeric character references.(strings/unescape mode text) → string
(strings/unescape mode) → function
- template? — Returns
true if value is a string template, otherwise false.(template? value) → boolean
- time/duration — With one argument, a number supplies a raw 100 ns tick count and a string
supplies an ISO duration. A float is rounded to the nearest tick, with halfway
cases rounded away from zero and a minimum of one tick in magnitude for
nonzero values:
(time/duration 1.5) is two ticks.(time/duration value) → duration
(time/duration amount unit) → duration
- time/duration? — Returns whether the value has the duration kind. UTC timestamps and integers
return
false.(time/duration? value) → boolean
- time/format — Formats a UTC timestamp or duration as its canonical ISO string, without a
DUST tag prefix. The full 100 ns tick precision is retained. For readable display text,
use the String library's
strings/humanize function.(time/format value) → string
- time/now — Returns the current wall-clock time as a typed UTC value with 100 ns tick
storage. Takes no arguments. The wall clock can change independently of
evaluation; this function does not provide a monotonic elapsed-time clock.
(time/now) → UTC
- time/parts — Returns integer fields
year, month, day, hour, minute, second,
nanosecond, and weekday. Months and days start at one. ISO weekdays run from
one for Monday through seven for Sunday. The nanosecond field is the fractional
part of the second, from zero through 999999900 in multiples of 100.(time/parts timestamp) → map
- time/round — Returns the nearest multiple of
quantum, with halfway cases rounded away
from zero. At a one-second quantum, 1.5s becomes 2s and -1.5s becomes -2s.(time/round duration quantum) → duration
- time/shift — Shifts by a map containing integer
years, months, and days offsets.
Omitted offsets are zero; negative offsets move backward. Unknown fields and
non-integer offsets are errors.(time/shift timestamp changes) → UTC
- time/start-of — Returns the start of the containing UTC calendar unit. The unit is one of
year, month, week, day, hour, minute, or second.
This floors to the earlier boundary, including for times before the Unix epoch.
A week's Monday can fall in the preceding month or year.(time/start-of timestamp unit) → UTC
- time/truncate — Returns the multiple of
quantum reached by truncating toward zero.
For example, 1.9s becomes 1s and -1.9s becomes -1s at a one-second quantum.(time/truncate duration quantum) → duration
- time/units — Expresses a UTC timestamp or duration in the requested unit. The unit argument
comes first. For UTC, the result measures time since the Unix epoch; for a
duration, it measures the elapsed interval. The underlying value remains a
signed count of 100 ns ticks.
(time/units unit value) → number
- time/utc — An integer supplies a raw count of 100 ns ticks since the Unix epoch. A string
supplies a UTC timestamp ending in
Z. A float supplies a Julian day, following SQLite's
Julian-day convention: day 0.0 is -4713-11-24T12:00:00Z, 2440587.5 is the Unix epoch,
and 2451545.0 is 2000-01-01T12:00:00Z.(time/utc value) → UTC
- time/utc? — Returns whether the value has the UTC kind. Durations and integers return
false.(time/utc? value) → boolean
- true? — Returns
true if value is the boolean true, otherwise false.(true? value) → boolean
- unquote — Evaluates the enclosed form within its matching quasiquote and substitutes
the resulting value. Outside quasiquote, this is an error.
See Quotation forms for prefix syntax and encoding.
#unquote form
- unquote-splicing — Evaluates the enclosed list within its matching quasiquote and inserts its
elements into the surrounding list. A non-list result or a splice outside a
list-element position is an error.
See Quotation forms for prefix syntax and encoding.
#unquote-splicing form
- values — Returns map values in the same ascending key order used by
keys.(values map) → list
- when — Runs a body when its test is truthy.
(when test body...)
- when-not — Runs a body when its test is falsey.
(when-not test body...)