Consts | Types | Logic | Arith | Bit/Set | String | Data | Iterator | Function | IO |
---|---|---|---|---|---|---|---|---|---|
nil |
num |
and |
+ |
~ |
parse |
len |
iter |
bind |
print |
_ |
str |
or |
- |
| |
repr |
tail |
pairs |
@ |
error |
true |
tbl |
! |
* |
& |
bin |
const |
range |
import |
|
false |
fn_ |
== |
/ |
&~ |
oct |
push |
repeat |
||
inf |
!= |
// |
<< |
hex |
pop |
random |
|||
E |
is |
% |
>> |
chr |
++ |
map |
|||
PI |
< |
^ |
ord |
sub |
filter |
||||
> |
log |
find |
reduce |
||||||
<= |
abs |
replace |
any |
||||||
>= |
floor |
split |
all |
||||||
ceil |
join |
zip |
|||||||
cos |
pad |
chain |
|||||||
acos |
strip |
take |
|||||||
sin |
drop |
||||||||
asin |
min |
||||||||
tan |
max |
||||||||
atan |
sort |
||||||||
reverse |
Representation of nil, the absence of a value.
Arbitrarily 1.
Comparison functions return this value on success, however any non-nil value is considered true.
Numeric representation of infinity.
The constant E = 2.718281..
The constant PI = 3.141592..
Converts x to a number.
By default returns 0
.
If x is a number, x is returned unmodified.
If x is a string, x is parsed as a number.
Converts x to a string.
By default returns ""
.
If x is a string, x is returned unmodified
Otherwise, returns repr(x, 0)
Converts x to a table.
By default returns []
.
If x is a number, the table will be preallocated for x pairs.
If x is a table, a shallow copy of x is returned.
If x is iterabe, x is exhausted and stored in the resulting table as either key/value pairs or at increasing indices.
If a tail is provided, the new table inherits the tail’s elements.
Converts x to a function.
By default a function that consumes all arguments is returned. If x is a function, x is returned unmodified.
Note: the the name fn_
is used to avoid conflict with function declarations.
Lazily evaluates the logical and of x and y.
Lazily evaluates the logical or of x and y.
Evaluates the logical inverse of x.
Tests x and y for equality.
If x/y are nil, result is always true.
If x/y are numbers or strings, result is true if x and y are the same value.
If x/y are tables or functions, result is true if x and y reference the same value.
Returns true if x is of type t.
If x and t are both tables, returns true if x inherits t.
Compares x and y.
Numbers are ordered numerically. Strings are ordered lexicographically.
Returns x unmodified or the sum of x and y.
Returns the negation of x or the difference of x and y.
Returns the product of x and y.
Returns the quotient of x and y.
Returns the floored quotient of x and y.
Returns the modulo of x and y.
Returns x raised to the power of y.
Returns the logarithm of x.
By default the base is e.
Returns the absolute value of x.
Returns the largest integer value <= x.
Returns the smallest integer value >= x.
Returns the cosine and arc-cosine in radians.
Returns the sine and arc-sine in radians.
Returns the tangent and arc-tangent in radians.
Optionally, atan can take two values. This is equivalent to atan(y/x)
but in the correct quadrant.
Returns the bitwise not of x or the exclusive-or of x and y.
If x and y are tables, ~
performs the symmetric-difference of their keys.
Returns the bitwise-or of x and y.
If x and y are tables, |
performs the union of their keys.
Returns the bitwise-and of x and y.
If x and y are tables, &
performs the intersection of their keys.
Returns the bitwise and of x and ~y.
If x and y are tables, &~
performs the set-difference of their keys.
Returns x bit shifted left arithmetically by y digits.
Returns x bit shifted right arithmetically by y digits.
Returns the string x parsed as a Mu literal.
Returns nil if x could not be parsed.
Returns a string representation of x.
Depth indicates how many nested tables to represent, by default depth is 1
.
Returns the string representation of x in the specific base.
Returns the character represented by the number x in ascii.
Returns the numeric value of the character x in ascii.
Finds the first occurance of match in x.
If match is not found, nil is returned.
Otherwise, the lower and upper bounds of match are returned.
Replaces each occurance of m with r in x.
Returns an iterator of the substrings separated by the delimiter.
By default the delimiter is ''
.
Joins each element of x into a string separated by the delimiter.
By default the delimiter is ''
.
Pads x with padding until x has a length of at least len.
If len is negative, padding is added to the beginning of the string.
By default the padding is ' '
.
Strips padding from x.
Padding is stripped from both sides of x when dir is nil, the beginning when dir is negative, and the end when dir is positive.
By default the padding is ' '
.
Returns the number of elements in x.
Returns the tail chain of x.
Returns a constant reference to x.
Pushes v onto table x before the index.
By default, v is push onto the end of the table.
Pops v off the table x from the index
By default, v is popped off the end of the table.
Returns the concatenation of x and y.
When x/y are tables, a third argument can be provided to specify the offset for y.
Returns a subset of x specified by the range [lower, upper).
Negative bounds indicate offsets from the right, and infinity indicates an unlimited boundary.
The default upper bound is lower+1.
Returns an iterator that iterates over the elements of x.
Returns an iterator that iterates over the key/value pairs of x.
If x is not a table, increasing indices are used.
Returns an iterator through the range between start and stop incrementing by step.
By default start is 0
, stop is inf
, and step is 1
.
Returns an iterator that repeats x, n times.
By default n is inf
.
Returns a pseudo-random number generator seeded by n.
By default an arbitrary seed is used.
If the same n is passed into random, the same random sequence will be generated.
Lazily applies the x to each element in the iterator.
If x returns nil, the element is filtered out.
Lazily filters out elements in the iterator when x returns false.
Reduces the iterator to a single value by repeatedly applying x to an accumulator and element.
The inits are used to start the accumulator.
If the inits are nil, the first element of iter is used.
Returns true if x returns true for any element in the iterator.
Returns true if x returns true for each element in the iterator.
Iterates over the arguments in parallel, returning the aggregated elements.
If there is only a single iterator, it is treated as an iterator of iterators.
Iterates over the arguments in series.
If there is only a single iterator, it is treated as an iterator of iterators.
Consumes elements from the iterator and iterates over the consumed elements.
If n is a number, n elements are consumed. If n is a function, elements are consumed until n returns true.
Consumes elements from the iterator and iterates over the remaining elements.
If n is a number, n elements are consumed. If n is a function, elements are consumed until n returns true.
Returns the minimum value based on the comparison operators.
If only one argument is provided, it is iterated over to find the minimum.
The result is ordered by only the first value.
Returns the maximum value based on the comparison operators.
If only one argument is provided, it is iterated over to find the maximum.
The result is ordered by only the first value.
Returns an iterator that iterates over the elements of x in sorted order.
The result is ordered by only the first value.
Iterates over the elements of x in reversed order.
Returns a function that will call x with args prepended to arguments.
Returns a function that calls the functions composed from right to left.
Prints each of the arguments and appends a newline.
repr is called on any argument that is not a string.
Errors with a message composed in the same was as print.
Imports a module.
Available modules are implementation dependent.
If the module is not found, nil is returned.
Otherwise, a table is returned containing the module’s functions and variables.