Vsak operator, ki ga program .lolo lahko pokliče, iz kanoničnega registra, ki ga prevajalnik vgradi.
Imenski prostori na tej strani: array/, data/, json/, math/, object/, path/, str/.
array/appendAdd item to end (returns new array)
(array/append arr item)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
item | any | Item to add |
Vrne: array
Primer
(array/append [1 2] 3) // => [1, 2, 3]array/avgAverage of values (optionally by field)
(array/avg arr key)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
key | string | Field to average |
Vrne: number
Primer
(array/avg [{"score":80},{"score":90}] "score")array/concatConcatenate arrays
(array/concat ...arrs)Parametri
| Ime | Tip | Opis |
|---|---|---|
...arrs | array[] | Arrays to concatenate |
Vrne: array
Primer
(array/concat [1 2] [3 4]) // => [1, 2, 3, 4]array/cosineCosine similarity between two numeric vectors, in [-1, 1] (1 = identical direction). The building block for "is this answer semantically the reference answer" checks over embeddings. Pure math — usable in guards and value position, unlike the async llm/* substrate operators.
(array/cosine v1 v2)Parametri
| Ime | Tip | Opis |
|---|---|---|
v1 | array | First numeric vector |
v2 | array | Second numeric vector |
Vrne: number
Primer
(array/cosine [1 0] [1 0]) // => 1array/countCount elements (optionally matching predicate)
(array/count arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: number
Primer
(array/count [{"status":"done"},{"status":"todo"}] ["fn","t",["=","@t.status","done"]])array/dropSkip first n elements
(array/drop arr n)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
n | number | Number of elements to skip |
Vrne: array
Primer
(array/drop [1,2,3,4,5,6,7] 5)array/dropLastSkip last n elements
(array/dropLast arr n)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
n | number | Number of elements to skip |
Vrne: array
Primer
(array/dropLast [1,2,3,4,5] 2)array/everyCheck if all elements match predicate
(array/every arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: boolean
Primer
(array/every [{"price":5},{"price":10}] ["fn","x",[">","@x.price",0]])array/filterKeep elements matching predicate (returns same array element type as input)
(array/filter arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: array
Primer
(array/filter [{"price":50},{"price":150}] ["fn","x",[">","@x.price",100]])array/findFind first element matching predicate (element type of input array, undefined when no match)
(array/find arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: any
Primer
(array/find [{"status":"active"},{"status":"archived"}] ["fn","x",["=","@x.status","active"]])array/findIndexFind index of first element matching predicate (-1 if none)
(array/findIndex arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: number
Primer
(array/findIndex [{"status":"active"},{"status":"archived"}] ["fn","x",["=","@x.status","active"]])array/firstGet first element (element type of input array, may be undefined when empty)
(array/first arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: any
Primer
(array/first [1 2 3]) // => 1array/flattenFlatten nested arrays one level
(array/flatten arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: array
Primer
(array/flatten [[1 2] [3 4]]) // => [1, 2, 3, 4]array/groupByGroup elements by field value
(array/groupBy arr key)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
key | string | Field to group by |
Vrne: any
Primer
(array/groupBy [{"status":"new"},{"status":"done"}] "status")array/includesCheck if array contains item
(array/includes arr item)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
item | any | Item to find |
Vrne: boolean
Primer
(array/includes [1 2 3] 2) // => truearray/indexOfFind index of item (-1 if not found)
(array/indexOf arr item)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
item | any | Item to find |
Vrne: number
Primer
(array/indexOf [1 2 3] 2) // => 1array/insertInsert item at index (returns new array)
(array/insert arr index item)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
index | number | Index to insert at |
item | any | Item to insert |
Vrne: array
Primer
(array/insert [1 3] 1 2) // => [1, 2, 3]array/lastGet last element (element type of input array, may be undefined when empty)
(array/last arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: any
Primer
(array/last [1 2 3]) // => 3array/lenArray length
(array/len arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: number
Primer
(array/len [1 2 3]) // => 3array/mapTransform each element (return type wraps the lambda result in an array)
(array/map arr fn)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
fn | lambda | Transform function |
Vrne: array
Primer
(array/map [{"price":100},{"price":200}] ["fn","x",["*","@x.price",1.1]])array/maxMaximum value (optionally by field)
(array/max arr key)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
key | string | Field to compare |
Vrne: number
Primer
(array/max [{"price":3},{"price":9}] "price")array/minMinimum value (optionally by field)
(array/min arr key)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
key | string | Field to compare |
Vrne: number
Primer
(array/min [{"price":3},{"price":9}] "price")array/nearestFind the candidate vector nearest a query vector by cosine similarity. Returns { index, score, margin } — index/score of the best match, and margin (best score minus second-best), which is what makes an abstaining gate possible: a small margin means the top match is not confidently distinguished from the runner-up.
(array/nearest query candidates)Parametri
| Ime | Tip | Opis |
|---|---|---|
query | array | Query vector |
candidates | array | Array of candidate vectors |
Vrne: object
Primer
(array/nearest [1 0] [[1 0] [0 1]]) // => {"index": 0, "score": 1, "margin": 1}array/nthGet element at index (element type of input array, may be undefined out-of-bounds)
(array/nth arr index)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
index | number | Index (0-based) |
Vrne: any
Primer
(array/nth [1 2 3] 1) // => 2array/partitionSplit array by predicate into [matches, nonMatches]
(array/partition arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: array
Primer
(array/partition [{"price":30},{"price":80}] ["fn","x",[">","@x.price",50]])array/prependAdd item to start (returns new array)
(array/prepend arr item)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
item | any | Item to add |
Vrne: array
Primer
(array/prepend [2 3] 1) // => [1, 2, 3]array/rangeGenerate numbers: (range n) => [0,n); (range start end) => [start,end); optional step
(array/range n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | Upper bound or length (variadic) |
Vrne: array
Primer
(array/range 3) // => [0 1 2]array/reduceReduce array to single value (return type matches the lambda result / init type)
(array/reduce arr fn init)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
fn | lambda | Reducer function (acc, item) => newAcc |
init | any | Initial accumulator value |
Vrne: any
Primer
(array/reduce [{"price":10},{"price":25}] 0 ["fn",["acc","x"],["+","@acc","@x.price"]])array/rejectRemove elements matching predicate (returns same array element type as input)
(array/reject arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: array
Primer
(array/reject [{"status":"active"},{"status":"deleted"}] ["fn","x",["=","@x.status","deleted"]])array/removeRemove item at index (returns new array)
(array/remove arr index)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
index | number | Index to remove |
Vrne: array
Primer
(array/remove [1 2 3] 1) // => [1, 3]array/removeItemRemove first matching item (returns new array)
(array/removeItem arr item)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
item | any | Item to remove |
Vrne: array
Primer
(array/removeItem [1 2 3 2] 2) // => [1, 3, 2]array/reverseReverse array order (returns new array)
(array/reverse arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: array
Primer
(array/reverse [1 2 3]) // => [3, 2, 1]array/shuffleRandomly shuffle array (returns new array)
(array/shuffle arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: array
Primer
(array/shuffle [1 2 3 4 5])array/sliceExtract subarray
(array/slice arr start end)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
start | number | Start index |
end | number | End index (exclusive) |
Vrne: array
Primer
(array/slice [1 2 3 4] 1 3) // => [2, 3]array/someCheck if any element matches predicate
(array/some arr pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
pred | lambda | Predicate function |
Vrne: boolean
Primer
(array/some [{"status":"archived"},{"status":"active"}] ["fn","x",["=","@x.status","active"]])array/sortSort array (returns new array)
(array/sort arr key dir)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
key | string | Field to sort by (for objects) |
dir | string | "asc" or "desc" |
Vrne: array
Primer
(array/sort [{"price":3},{"price":9},{"price":5}] "price" "desc")array/sumSum values (optionally by field)
(array/sum arr key)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
key | string | Field to sum |
Vrne: number
Primer
(array/sum [{"price":10},{"price":25}] "price")array/takeTake first n elements
(array/take arr n)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
n | number | Number of elements |
Vrne: array
Primer
(array/take [1,2,3,4,5,6,7] 5)array/takeLastTake last n elements
(array/takeLast arr n)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
n | number | Number of elements |
Vrne: array
Primer
(array/takeLast [1,2,3,4,5] 3)array/uniqueRemove duplicates (returns new array)
(array/unique arr)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | The array |
Vrne: array
Primer
(array/unique [1 2 2 3 1]) // => [1, 2, 3]array/zipPair elements from two arrays
(array/zip arr1 arr2)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr1 | array | First array |
arr2 | array | Second array |
Vrne: array
Primer
(array/zip [1 2] (a "b")) // => [[1, "a"], [2, "b"]]data/augmentApply data augmentation
(data/augment data config)Parametri
| Ime | Tip | Opis |
|---|---|---|
data | object | Data object |
config | object | Augmentation config |
Vrne: object
Primer
(data/augment [[1.0,2.0],[3.0,4.0]] {"flip":true,"rotate":15}) // => {}data/dataloaderCreate batched dataloader from dataset
(data/dataloader dataset batchSize)Parametri
| Ime | Tip | Opis |
|---|---|---|
dataset | object | Dataset to load |
batchSize | number | Batch size |
Vrne: object
Primer
(data/dataloader ["data/dataset",[[1,2],[3,4],[5,6]],{}] {"batch-size":2,"shuffle":true})data/datasetCreate dataset from entity collection and contracts
(data/dataset entities schema)Parametri
| Ime | Tip | Opis |
|---|---|---|
entities | array | Entity collection |
schema | object | Data schema |
Vrne: object
Primer
(data/dataset [{"x":1,"y":2}] {"input":{"fields":["x"]},"output":{"fields":["y"]}})data/normalizeNormalize features (mean/std or min/max)
(data/normalize tensor mode)Parametri
| Ime | Tip | Opis |
|---|---|---|
tensor | object | Input tensor |
mode | string | Normalization mode |
Vrne: tensor
Primer
(data/normalize [[1,2],[3,4]] {"method":"standard"})data/padPad sequences to uniform length
(data/pad sequences maxLen)Parametri
| Ime | Tip | Opis |
|---|---|---|
sequences | array | Sequences to pad |
maxLen | number | Target length |
Vrne: tensor
Primer
(data/pad [[1,2,3],[4,5]] {"max-length":4,"pad-value":0})data/splitTrain/validation split. Config carries trainRatio (default 0.8); the remainder is the validation split.
(data/split dataset config)Parametri
| Ime | Tip | Opis |
|---|---|---|
dataset | object | Dataset to split |
config | object | Split config |
Vrne: array
Primer
(data/split ["data/dataset",[1,2,3,4,5],{}] {"trainRatio":0.8})data/tokenizeTokenize text fields
(data/tokenize texts vocab)Parametri
| Ime | Tip | Opis |
|---|---|---|
texts | array | Texts to tokenize |
vocab | object | Vocabulary mapping |
Vrne: tensor
Primer
(data/tokenize "hello world" {"method":"bpe","max-length":512})json/parseParse a JSON string into a value; invalid JSON or non-string input returns null (never throws)
(json/parse s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The JSON string to parse |
Vrne: any
Primer
(json/parse "{\"a\": 1}") // => {a: 1}json/stringifySerialize any value to a JSON string
(json/stringify v)Parametri
| Ime | Tip | Opis |
|---|---|---|
v | any | The value to serialize |
Vrne: string
Primer
["json/stringify", {a: 1}] // => "{\"a\":1}"math/absAbsolute value
(math/abs n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/abs -5) // => 5math/acosArccosine (inverse cosine) in radians
(math/acos x)Parametri
| Ime | Tip | Opis |
|---|---|---|
x | number | Input value between -1 and 1 |
Vrne: number
Primer
(math/acos 0.5) // => 1.0472math/approachMove cur toward target by at most maxDelta
(math/approach cur target max)Parametri
| Ime | Tip | Opis |
|---|---|---|
cur | number | Current value |
target | number | Target value |
max | number | Maximum delta per step |
Vrne: number
Primer
(math/approach 10 20 3) // => 13math/asinArcsine (inverse sine) in radians
(math/asin x)Parametri
| Ime | Tip | Opis |
|---|---|---|
x | number | Input value between -1 and 1 |
Vrne: number
Primer
(math/asin 0.5) // => 0.5236math/atanArctangent (inverse tangent) in radians
(math/atan x)Parametri
| Ime | Tip | Opis |
|---|---|---|
x | number | Input value |
Vrne: number
Primer
(math/atan 1) // => 0.7854math/atan2Angle in radians from the positive x-axis to point (x, y)
(math/atan2 y x)Parametri
| Ime | Tip | Opis |
|---|---|---|
y | number | Y coordinate |
x | number | X coordinate |
Vrne: number
Primer
(math/atan2 1 1) // => 0.7854math/ceilRound up to integer
(math/ceil n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/ceil 3.2) // => 4math/clampConstrain value to range [min, max]
(math/clamp n min max)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The value to clamp |
min | number | Minimum bound |
max | number | Maximum bound |
Vrne: number
Primer
(math/clamp 150 0 100) // => 100math/cosCosine of an angle in radians
(math/cos radians)Parametri
| Ime | Tip | Opis |
|---|---|---|
radians | number | Angle in radians |
Vrne: number
Primer
(math/cos 0) // => 1math/defaultReturn default if value is null, undefined, or NaN
(math/default default)Parametri
| Ime | Tip | Opis |
|---|---|---|
default | number | Default value |
Vrne: number
Primer
(math/default null 0) // => 0math/deg-radConvert degrees to radians
(math/deg-rad degrees)Parametri
| Ime | Tip | Opis |
|---|---|---|
degrees | number | Angle in degrees |
Vrne: number
Primer
(math/deg-rad 180) // => 3.1416math/floorRound down to integer
(math/floor n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/floor 3.7) // => 3math/hypotEuclidean length sqrt(a²+b²)
(math/hypot a b)Parametri
| Ime | Tip | Opis |
|---|---|---|
a | number | First side |
b | number | Second side |
Vrne: number
Primer
(math/hypot 3 4) // => 5math/lerpLinear interpolation between a and b by factor t
(math/lerp a b t)Parametri
| Ime | Tip | Opis |
|---|---|---|
a | number | Start value |
b | number | End value |
t | number | Interpolation factor (0-1) |
Vrne: number
Primer
(math/lerp 0 100 0.5) // => 50math/lnNatural logarithm (base e)
(math/ln n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/ln 2.718281828) // => 1math/log10Base-10 logarithm
(math/log10 n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/log10 100) // => 2math/mapMap value from one range to another
(math/map n inMin inMax outMin outMax)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The value |
inMin | number | Input range minimum |
inMax | number | Input range maximum |
outMin | number | Output range minimum |
outMax | number | Output range maximum |
Vrne: number
Primer
(math/map 5 0 10 0 100) // => 50math/maxMaximum of values
(math/max ...nums)Parametri
| Ime | Tip | Opis |
|---|---|---|
...nums | number[] | Numbers to compare |
Vrne: number
Primer
(math/max 3 1 4) // => 4math/minMinimum of values
(math/min ...nums)Parametri
| Ime | Tip | Opis |
|---|---|---|
...nums | number[] | Numbers to compare |
Vrne: number
Primer
(math/min 3 1 4) // => 1math/modModulo (remainder)
(math/mod a b)Parametri
| Ime | Tip | Opis |
|---|---|---|
a | number | Dividend |
b | number | Divisor |
Vrne: number
Primer
(math/mod 7 3) // => 1math/powExponentiation (base^exp)
(math/pow base exp)Parametri
| Ime | Tip | Opis |
|---|---|---|
base | number | The base |
exp | number | The exponent |
Vrne: number
Primer
(math/pow 2 8) // => 256math/rad-degConvert radians to degrees
(math/rad-deg radians)Parametri
| Ime | Tip | Opis |
|---|---|---|
radians | number | Angle in radians |
Vrne: number
Primer
(math/rad-deg 3.1416) // => 180math/randomRandom number between 0 (inclusive) and 1 (exclusive)
(math/random)Vrne: number
Primer
(math/random) // => 0.7234...math/randomIntRandom integer in range [min, max] (inclusive)
(math/randomInt min max)Parametri
| Ime | Tip | Opis |
|---|---|---|
min | number | Minimum (inclusive) |
max | number | Maximum (inclusive) |
Vrne: number
Primer
(math/randomInt 1 6) // => 4math/roundRound to nearest integer or specified decimals
(math/round n decimals)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
decimals | number | Decimal places |
Vrne: number
Primer
(math/round 3.456 2) // => 3.46math/signReturns -1, 0, or 1 indicating sign
(math/sign n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/sign -42) // => -1math/sinSine of an angle in radians
(math/sin radians)Parametri
| Ime | Tip | Opis |
|---|---|---|
radians | number | Angle in radians |
Vrne: number
Primer
(math/sin 1.5708) // => 1math/sqrtSquare root
(math/sqrt n)Parametri
| Ime | Tip | Opis |
|---|---|---|
n | number | The number |
Vrne: number
Primer
(math/sqrt 16) // => 4math/tanTangent of an angle in radians
(math/tan radians)Parametri
| Ime | Tip | Opis |
|---|---|---|
radians | number | Angle in radians |
Vrne: number
Primer
(math/tan 0.7854) // => 1math/wrapWrap a value into the half-open range [min, max)
(math/wrap value min max)Parametri
| Ime | Tip | Opis |
|---|---|---|
value | number | Value to wrap |
min | number | Minimum bound |
max | number | Maximum bound |
Vrne: number
Primer
(math/wrap 15 0 10) // => 5object/cloneShallow clone object
(object/clone obj)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
Vrne: any
Primer
(object/clone {"a":1,"b":2})object/deepCloneDeep clone object
(object/deepClone obj)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
Vrne: any
Primer
(object/deepClone {"a":{"b":2}})object/deepMergeDeep merge objects (later wins)
(object/deepMerge ...objs)Parametri
| Ime | Tip | Opis |
|---|---|---|
...objs | object[] | Objects to merge |
Vrne: any
Primer
(object/deepMerge {"a": {"b": 1}} {"a": {"c": 2}})object/entriesGet [key, value] pairs as array
(object/entries obj)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
Vrne: array
Primer
(object/entries {"a": 1}) // => [["a", 1]]object/equalsDeep equality check
(object/equals a b)Parametri
| Ime | Tip | Opis |
|---|---|---|
a | object | First object |
b | object | Second object |
Vrne: boolean
Primer
(object/equals {"a": 1} {"a": 1}) // => trueobject/filterFilter entries by predicate
(object/filter obj pred)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
pred | lambda | Predicate (key, value) => boolean |
Vrne: any
Primer
(object/filter {"a":1,"b":null} ["fn",["k","v"],["!=","@v",null]])object/fromEntriesCreate object from [key, value] pairs
(object/fromEntries entries)Parametri
| Ime | Tip | Opis |
|---|---|---|
entries | array | Array of [key, value] pairs |
Vrne: any
Primer
(object/fromEntries [["a" 1] ["b" 2]]) // => {"a": 1, "b": 2}object/getGet nested value by path (return type derived from input object shape and key)
(object/get obj path default)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
path | string | Dot-separated path (e.g., "user.name") |
default | any | Default if path not found |
Vrne: any
Primer
(object/get {"profile":{"name":"Ann"}} "profile.name" "Anonymous")object/hasCheck if path exists
(object/has obj path)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
path | string | Dot-separated path |
Vrne: boolean
Primer
(object/has {"profile":{"name":"Ann"}} "profile.name")object/keysGet object keys as array
(object/keys obj)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
Vrne: array
Primer
(object/keys {"a":1,"b":2}) // => ["a", "b"]object/mapKeysTransform all keys
(object/mapKeys obj fn)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
fn | lambda | Transform function |
Vrne: any
Primer
(object/mapKeys {"a":1,"b":2} ["fn","k",["str/upper","@k"]])object/mapValuesTransform all values
(object/mapValues obj fn)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
fn | lambda | Transform function |
Vrne: any
Primer
(object/mapValues {"a":0.5,"b":0.25} ["fn","v",["*","@v",100]])object/mergeShallow merge objects (later wins)
(object/merge ...objs)Parametri
| Ime | Tip | Opis |
|---|---|---|
...objs | object[] | Objects to merge |
Vrne: any
Primer
(object/merge {"a": 1} {"b": 2}) // => {"a": 1, "b": 2}object/omitExclude specified keys
(object/omit obj keys)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
keys | array | Keys to exclude |
Vrne: any
Primer
(object/omit {"name":"Ann","password":"x"} ["password"])object/pickSelect only specified keys (return type is subset of input object shape)
(object/pick obj keys)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
keys | array | Keys to keep |
Vrne: any
Primer
(object/pick {"name":"Ann","email":"ann@example.com","age":30} ["name","email"])object/setSet nested value by path (returns new object)
(object/set obj path value)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
path | string | Dot-separated path |
value | any | Value to set |
Vrne: any
Primer
(object/set {"profile":{"name":"Ann"}} "profile.name" "John")object/valuesGet object values as array
(object/values obj)Parametri
| Ime | Tip | Opis |
|---|---|---|
obj | object | The object |
Vrne: array
Primer
(object/values {"a":1,"b":2}) // => [1, 2]path/astarA* shortest path on a w×h grid; returns cells start→goal (incl. both) or [] if none
(path/astar width height grid start goal)Parametri
| Ime | Tip | Opis |
|---|---|---|
width | number | Grid width |
height | number | Grid height |
grid | array | Grid data |
start | array | Start coordinates |
goal | array | Goal coordinates (variadic) |
Vrne: array
Primer
(path/astar {"x":0,"y":0} {"x":2,"y":0} [] 3 1)path/reachableBFS cells reachable within N moves from start (incl. start); sorted row-major
(path/reachable width height grid start moves)Parametri
| Ime | Tip | Opis |
|---|---|---|
width | number | Grid width |
height | number | Grid height |
grid | array | Grid data |
start | array | Start coordinates |
moves | number | Maximum moves (variadic) |
Vrne: array
Primer
(path/reachable {"x":1,"y":1} 1 [] 3 3 false)str/camelCaseConvert to camelCase
(str/camelCase s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/camelCase "hello world") // => "helloWorld"str/capitalizeCapitalize first character
(str/capitalize s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/capitalize "hello") // => "Hello"str/concatConcatenate strings together
(str/concat str)Parametri
| Ime | Tip | Opis |
|---|---|---|
str | string | String to concatenate (variadic) |
Vrne: string
Primer
(str/concat "Hello" " " "World") // => "Hello World"str/defaultReturn default if value is null/undefined/empty
(str/default default)Parametri
| Ime | Tip | Opis |
|---|---|---|
default | string | Default value |
Vrne: string
Primer
(str/default null "N/A") // => "N/A"str/endsWithCheck if string ends with suffix
(str/endsWith s suffix)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
suffix | string | Suffix to check |
Vrne: boolean
Primer
(str/endsWith "hello" "lo") // => truestr/includesCheck if string contains substring
(str/includes s search)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
search | string | Substring to find |
Vrne: boolean
Primer
(str/includes "hello world" "world") // => truestr/joinJoin array elements into string
(str/join arr delim)Parametri
| Ime | Tip | Opis |
|---|---|---|
arr | array | Array to join |
delim | string | Delimiter |
Vrne: string
Primer
(str/join (a "b" "c") ", ") // => "a, b, c"str/kebabCaseConvert to kebab-case
(str/kebabCase s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/kebabCase "Hello World") // => "hello-world"str/lenString length
(str/len s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: number
Primer
(str/len "hello") // => 5str/lowerConvert to lowercase
(str/lower s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/lower "HELLO") // => "hello"str/padEndPad string from end to target length
(str/padEnd s len char)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
len | number | Target length |
char | string | Padding character |
Vrne: string
Primer
(str/padEnd "5" 3 "0") // => "500"str/padStartPad string from start to target length
(str/padStart s len char)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
len | number | Target length |
char | string | Padding character |
Vrne: string
Primer
(str/padStart "5" 3 "0") // => "005"str/repeatRepeat string n times
(str/repeat s count)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
count | number | Repeat count |
Vrne: string
Primer
(str/repeat "ab" 3) // => "ababab"str/replaceReplace first occurrence
(str/replace s find replace)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
find | string | String to find |
replace | string | Replacement |
Vrne: string
Primer
(str/replace "hello world" "world" "there") // => "hello there"str/replaceAllReplace all occurrences
(str/replaceAll s find replace)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
find | string | String to find |
replace | string | Replacement |
Vrne: string
Primer
(str/replaceAll "a-b-c" "-" "_") // => "a_b_c"str/reverseReverse string
(str/reverse s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/reverse "hello") // => "olleh"str/sliceExtract substring
(str/slice s start end)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
start | number | Start index |
end | number | End index (exclusive) |
Vrne: string
Primer
(str/slice "hello" 1 4) // => "ell"str/snakeCaseConvert to snake_case
(str/snakeCase s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/snakeCase "Hello World") // => "hello_world"str/splitSplit string into array by delimiter
(str/split s delim)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
delim | string | Delimiter |
Vrne: array
Primer
(str/split "a,b,c" ",") // => ["a", "b", "c"]str/startsWithCheck if string starts with prefix
(str/startsWith s prefix)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
prefix | string | Prefix to check |
Vrne: boolean
Primer
(str/startsWith "hello" "hel") // => truestr/templateVariable substitution in template string
(str/template template vars)Parametri
| Ime | Tip | Opis |
|---|---|---|
template | string | Template with {placeholders} |
vars | object | Variables to substitute |
Vrne: string
Primer
(str/template "Hello, {name}!" {"name":"World"}) // => "Hello, World!"str/titleCaseConvert to Title Case
(str/titleCase s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/titleCase "hello world") // => "Hello World"str/trimRemove leading and trailing whitespace
(str/trim s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/trim " hello ") // => "hello"str/trimEndRemove trailing whitespace
(str/trimEnd s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/trimEnd "hello ") // => "hello"str/trimStartRemove leading whitespace
(str/trimStart s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/trimStart " hello") // => "hello"str/truncateTruncate string with optional suffix
(str/truncate s len suffix)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
len | number | Maximum length |
suffix | string | Suffix for truncated strings |
Vrne: string
Primer
(str/truncate "Hello World" 8 "...") // => "Hello..."str/upperConvert to uppercase
(str/upper s)Parametri
| Ime | Tip | Opis |
|---|---|---|
s | string | The string |
Vrne: string
Primer
(str/upper "hello") // => "HELLO"