The sole value of the Nil type. nil
is frequently
used to represent the absence of a value.
Evaluates expr
, and binds the result to
name
.
Parentheses are used for grouping expressions. They do not otherwise change the meaning of the program.
Evaluation of a number literal yields a numeric value. Integer, decimal, and scientific notation is supported.
These arithmetic operations raise exceptions if their arguments do not evaluate to numbers. Otherwise, they perform the specified operation.
The true and false values of the boolean type.
Evaluation of a string literal yields a string value. String values hold ordered sequences of characters. They are usually used as representations of human readable text.
Appends two strings together. This does not modify the strings, but instead produces a new string.
These operations perform the specified comparison, returning a boolean. Only numbers can be compared.
Evaluates the condition
, followed by either the
then_branch
or the else_branch
,
depending on its result.
Evaluating a function statement produces a function value
and binds it to name
. The function definition
does not evaluate the function body; this happens when the
function is called.
Applies a function to zero or more arguments.
Evaluates expr
, and changes the value
bound to name
.
Produces a first-class function value. It can be applied the same way as named functions.
On the left of each colon is a field name, and on the right is its definition. This syntax constructs a record where each field name is associated with its corresponding definition.
Evaluates the first expression to a record value and the second expression to a field name, then looks up that field name in that record.
The first expression is the record, the second is the field name, and the third is the new value. This syntax changes the record by setting the given field name to the new value.
For instance,
let record = {"x": 1}; record["x"] := 2; record["x"]
will produce 2
.