| _0 | Return 1st value of recipient. |
| _1 | Return 2nd value of recipient. |
| _2 | Return 3rd value of recipient. |
| abs | Return the absolute value of recipient. |
| allpairs | Return all possible [A,B] lists where A and B are elements of recipient list. |
| at | at(Key)
Return value at key or nil if not present. |
| call | Call recipient function with given arguments. |
| ceil | Return smallest integer that is greater than or equal to recipient. |
| cond | cond(Action1,...,ActionN, Else)
Takes the first truthy value in recipient and runs the corresponding action or Else if no value is truthy. If Else is not specified, returns nil when no value is truthy. |
| contents | Return contents of recipient file as string. |
| count | count(Fn)
Count the number of values in recipient where Fn returns truthy. |
| debug | Print internal interpreter state. |
| dec | Return the recipient decremented by 1. |
| digit | Return ASCII digit code as number, or nil if code is not a digit. |
| do | do(Fn)
Call Fn on each value in recipient, presumably for side effects. For maps, Fn is called with key and value as arguments. Returns nil. |
| drop | drop(N)
Return recipient without the first N values. |
| dropw | dropw(Pred)
Return items of recipient after the first Pred call on item returns falsy. |
| else | else(V)
Return recipient value if it is truthy, otherwise return V. |
| empty? | True if recipient is nil, the empty list or an empty map. |
| ends? | ends(Suffix)
Returns true if recipient ends with Suffix, false otherwise. |
| eval | Eval recipient as elf code, returns the last value. |
| filter | filter(Fn)
Call Fn on each value in recipient, return list of values where the result is truthy. |
| first | Return first value in recipient. |
| floor | Return largest integer that is less than or equal to recipient. |
| fmt | fmt(Arg1,...,ArgN)
Format recipient string with given parameters, any use "%s" and "%d" to mark argument strings and numbers. |
| fold | fold(Fn, Init)
Call Fn with Init and first value of recipient, then with successive return values and values in recipient until all values are processed. If Init is omitted, nil is used. |
| group | group(Fn)
Group values in recipient by Fn. Calls Fn on each value in recipient and returns map with the result as key and list of values having that result as value. |
| has? | has?(Item)
True if Item is member of recipient list, false otherwise. |
| heads | Return successive heads of recipient. |
| if | if(Then)
If recipient is truthy, return Then. If Then is a function, it is called with the recipient as argument and its return value is returned. |
| if | if(Then,Else)
If recipient is truthy, return Then otherwise return Else. Both can be values or functions. |
| in? | in?(List)
True if recipient is a member of List, false otherwise. |
| inc | Return the recipient incremented by 1. |
| index | index(Elt)
Returns the first index of Elt in recipient list or -1 if it does not appear in the list. |
| join | join(Sep)
Join recipient list of lists into one list with separator. |
| keep | keep(Fn)
Call Fn on all values in recipient, returns list of all results that are not nil. |
| last | Return last value in recipient. |
| len | Returns the length of a list. |
| lines | Return list of lines in file. |
| list? | True if recipient is a list, false otherwise. |
| map | map(Fn)
Call Fn on all values in recipient and returns values as a list. |
| map? | True if recipient is a map, false otherwise. |
| mapcat | mapcat(Fn)
Call Fn on all values in recipient appending all resulting lists in one list. Fn must return a list or nil. |
| match | match(Input)
Parse input by matching it to specs in recipient list. Each spec can be a list expected at this position or a function that parses from the current position. Parsing function must return a parsed value and the rest of the list. Returns list of all non-nil values parsed by parsing functions. |
| max | Return the maximum value of a list of numbers. |
| max | max(Fn)
Call Fn on each value in recipient, return the maximum value. |
| maxw | maxw(Fn)
Call Fn on each value in recipient, return list containing the largest result and the value it corresponds with. |
| min | Return the minimum value of a list of numbers. |
| min | min(Fn)
Call Fn on each value in recipient, return the minimum value. |
| minw | minw(Fn)
Call Fn on each value in recipient, return list containing the smallest result and the value it corresponds with. |
| nil? | True if recipient is nil, false otherwise. |
| not | Return negated boolean of recipient. |
| nth | nth(N)
Return the Nth value in recipient. |
| number? | True if recipient is a number, false otherwise. |
| numdigits | Return the number of digits in a number, eg. 123 => 3 |
| part | part(Size,[Skip])
Partition list into sublists of Size. If skip is omitted it is the same as Size. If skip is omitted, the last list may be shorter than the others if the input is not evenly sized.
Example:
[1,2,3,4] part(2,1)
=> [[1,2],[2,3],[3,4]]
|
| pow | pow(N)
Raise recipient to Nth power. |
| pr | Pretty print recipient. Returns recipient. |
| print | Print value to standard output. |
| put | put(Key1,Val1,...,KeyN,ValN)
Put values into map, returns new map with added mappings. |
| read | Read an Elf value (number, string, boolean or nil) from recipient string. Returns a list containing the read value and the rest of the string. |
| ref | Create new mutable reference from recipient. |
| reverse | Return recipient reversed. |
| round | Return the closest integer to recipient. |
| sign | Return -1, 0 or 1 if recipient is negative, zero or positive respectively. |
| some | some(Pred)
Returns the first value in recipient where the result of calling Pred on it returns truthy, or nil otherwise. |
| sort | Return recipient as sorted. |
| sort | sort(Fn)
Call Fn on each value in recipient, return recipient sorted by the return values. |
| sortu | Return recipient as sorted without duplicates. |
| split | split(Sep)
split recipient list into sublists at each occurence of separator Sep. |
| splitw | splitw(Pred)
Combines takew and dropw. Return list of [taken, dropped]. |
| starts? | starts?(Prefix)
Returns true if recipient starts with Prefix, false otherwise. |
| str | Return readable representation of recipient as string. |
| sum | Returns sum of all values in recipient. |
| swap | swap(Fn,...Args)
Update value of ref by calling Fn on its current value (and optional Args). Returns new value. |
| take | take(N)
Return the first N values of recipient. |
| takew | takew(Pred)
Return items of recipient list while calling Pred on item returns truthy. |
| to | to(Upto)
Return list of successive numbers from recipient to Upto. |
| to | to(Upto, Skip)
Return list of successive numbers from recipient to Upto, incrementing with Skip. |
| use | Load file denoted by recipient as elf code.
All record types, methods and names defined in the file are available after this call. |
| val | Get or set current value of mutable reference. |
| while | while(Then)
Call recipient fn repeatedly while it returns a truthy value, call Then with that value. |
| ws | Parsing method to skip 0 or more whitespace characters. Returns [nil, rest] where rest is the string after the whitespace. |