There are a number of function functions which might be common or useful enough to provide by default. Some options:
Examples
General
Type conversion functions could be useful, e.g.
Booleans
These would be useful for if statements
Numbers
Strings
Lists
Maps
There are a number of function functions which might be common or useful enough to provide by default. Some options:
Examples
General
Type conversion functions could be useful, e.g.
bool: convert a value to a boolean using "truthy" logic, e.g. empty string, list, and map isfalse, zero integer and float is false.int: convert from boolean and float to intlist: convert map to a list of lists of length two.Booleans
These would be useful for if statements
eq,negt,gte,lt,lteand,ornotNumbers
abs: returns the absolute value of the numberadd <v>,sub <v>mul <v>,div <v>round: rounds to the given precisionStrings
len/length/size: return the length of the stringlower: convert a string to lowercaseupper: convert a string to uppercasetitle: convert a string to titlecasetrim/strip: trims whitespace from a stringltrim/lstrip,rtrim/rstrip: trims whitespace from a string from the one endreverse: reverses the listreplace <from> <to>: replaces a substring with anotherappend <s>: appends the given stringprepend <s>: prepends the given stringLists
len/length/size: return the length of the listfirst: return the first item in a listlast: return the last item in a listslice: slice a listnth <n>: return the nth item in a listjoin <sep>/concat <sep>: join a sequence by separatoruniq: remove any duplicate items from the listsorted: sorts the list (? how should differently typedValues be ordered?)Maps
len/length/size: return the length of the mapkeys: returns a list of the keys in the mapvalues: returns a list of the values in the mapfirst: return the first item in the maplast: return the last item in the map