abs
Return absolute value of a number, if null return null
abs(val)
add
Add item to the end of a list and return a new list.
add(val, item)
addAll
Add all the items to the end of a list and return a new list.
addAll (val, items)
addCol
Add a column to a grid by mapping each row to a new call value. The col parameter may be a simple string name or may be a distionary which must have a “name” tag (any other tags become column meta-data). The mapping funtion takes (row) and returns the new cell values for the column.
addCol (grid, col, fn)
addColMeta
Return a new grid with additional column meta-data
addColMeta (grid, name, meta)
addMeta
Add grid level meta-data tags.
addMeta(grid, meta)
addRow
Add an additional Dict row to the end of a grid.
addRow (grid, newRow)
addRows
Add an list of rows to the end of a grid. The newRows may be expressed as list of Dict or a Grid.
addRows (grid, newRows)
all
Return if all the items in a list, dict, or grid match the given test function. If the collection is empty, then return true.
If working with a list, the function takes (val) or (val, index) and returns true or false.
If working with a dict, theu function takes (val) or (val, name) and returns true or false.
If working with a grid, the function take (row) or (row, index) and returns true or false.
[1, 3, 5] . all v => v.isOdd >> true
[1, 3, 6] .all(isOdd) >>false
any
any(val, fn)
Return if any the items in a list, dict, or grid match the given test function. If the collection is empty, then return false.
If working with a list, the function takes (val) or (val, index) and returns true or false.
If working with a dict, the function takes (val) or (val, name) and returns true or false.
If working with a grid, the function takes (row) or (row, index) and returns true or false.
Examples:
[1, 3, 5].any v =\> v.isOdd \>\> true [2, 4, 6].any(isOdd) \>\> false
as
as(val, unit)
Set the unit of a number. Unlike to no conversion of the scalar of the number is performed. The target unit can be a unit string or a number in which case the scalar value of the unit parameter is ignored (by convention should be 1).
avg
avg(val, acc)
Fold multiple values into their standard average or arithmetic mean. This function is the same as math::mean. Null values are ignored. Return null if no values.
capitalize
capitalize(val)
Return this string with the first character converted to uppercase. The case conversion is for ASCII only.
chart
chart(val)
Set the grid visualization view to chart.
checkSyntax
checkSyntax(src)
Given an axon expression, validate the syntax. If there are no errors then return an empty grid. If there are errors then return a grid with the “err” tag and a “line” and “dis” column for each error found.
col
col(grid, name, checked: true)
Get a column by its name. If not resolved then return null or throw UnknownNameErr based on checked flag.
colNames
colNames(grid)
Get the column names a list of strings.
colToList
colToList(grid, col)
Get a column as a list of the cell values ordered by row.
cols
cols(grid)
Get the columns from a grid as a list.
colsToLocale
colsToLocale(grid)
Map each col display string to its localized tag name if the col does not already have a display string. Also see Grid.colsToLocale and Localization.
commit
commit(diffs)
Commit a diff or list of diffs to the folio database.
If one diff is passed, return the new record. If a list of diffs is passed return a list of new records.
Examples:
// add new record newRec: commit(diff(null, {dis:"New Rec!"}, {add})) // add someTag to some group of records readAll(filter).toRecList.map(r =\> diff(r, {someTag})).commitSide effects:
concat
concat(list, sep: "")
Concatenate a list of items into a string.
Examples:
[1, 2, 3].concat \>\> "123" [1, 2, 3].concat(",") \>\> "1,2,3"contains
contains(val, x)
Return if val contains x:
val is Str, then x is substring.val is List, then x is item to search.val is Range, then is x inside the range inclusivelyval is DateSpan, then is x a date in the spancontext
context()
Get the current context as a Dict with the following tags:
username for current useruserRef if user maps to a rec in current projectprojName if evaluating in context of a projectruleRef if evaluating in context of a spark engine rulelocale current locale