The table below summarizes the different expression forms in Wrapl. The following notation is used in the table; id_{i} denotes an idenitifer, expr_{i} denotes an expression and decl_{i} denotes a declaration.

Evaluates to the constant Std.Object.Nil, used to denote the absence of any other value.

Fails to produce any value, causing the current expression to backtrack.

Returns the value of expr. If expr is a reference, then . expr returns the current value of expr without any reference.

Returns the type of expr.

Returns expr_{2} if expr_{1} and expr_{2} are the same object, fails otherwise.

Returns expr_{2} if expr_{1} and expr_{2} are not the same object, fails otherwise.

Returns a list (instance of Std.List.T) with elements expr_{1}, expr_{2}, ..., expr_{k}

Returns a table (instance of Std.Table.T) with pairs (expr_{ki}, expr_{vi}). Any value expr_{vj} is omitted, the value NIL is used.

Returns a list of all the values produced by expr.

Returns a table with the (unique) values produced by expr as keys.

where signature is of the form [@|= expr_{1}], ..., [@|= expr_{k}].

Adds expr (which should be an invokable object) to :method corresponding to signature, where @ type denotes a type match and = value denotes a value match, using Std.Symbol.Set. Returns expr.

The old keyword can still be used instead of .

Assigns the value of expr_{2} to the reference produced by expr_{1}. If expr_{1} does not evalute to a reference then Wrapl.Loader.IncorrectAssignMessageT message is sent. Within the evaluation of expr_{2} the special variable $ can be used to refer to the current value of expr_{1}.

Assigns the value of expr_{1} to the reference produced by expr_{2}. If expr_{1} does not evalute to a reference then Wrapl.Loader.IncorrectAssignMessageT message is sent.

Creates a new function object with parameters id_{1}, ..., id_{k} and body expr. If a parameter is followed by + it is passed by reference, other it is passed by value. A * after the final parameter indicates that it is a variadic parameter, any extra arguments are collected into a Wrapl.Loader.VariadicT and passed in this parameter.

Creates a new Std.Function.VariableT object that returns the variable produced by expr. This is equivalent to a call to Std.Function.VariableNew with expr.

Creates a new Std.Function.ConstantT function object that returns the value produced by expr. This is equivalent to a call to Std.Function.ConstantNew with expr.

where signature is of the form [id_{1}[+]] [@|= expr_{1}], ..., [id_{k}[+|*]] [@|= expr_{k}].

Equivalent to METH :method(signature') IS func (see here) where signature' is the type/value information in signature (i.e. ignoring any identifiers and pass-by-reference markers) and func is the function: <id_{1}[+], ..., id_{k}[+]> [ VAR | DEF ] expr (creating unique id's for those omitted). Returns func.

The old keyword can still be used instead of .

Calls the function expr_{0} with arguments expr_{1}, ..., expr_{k}. If the function fails, expr_{k} is resumed and the function is called again. If expr_{k} fails, expr_{k-1} is resumed, and so on.

Calls the function expr_{0} with arguments expr_{1}, ..., expr_{k}. If the function fails, each expr_{1}, expr_{2}, ..., expr_{k} is resumed and the function is called again.

Returns expr from the current function.

Exits the current function without producing any value (failing).

Suspends the current function producing the value expr. If the function in resumed, evaluation continues with SUSP expr producing the value of expr.

If expr_{0} succeeds, returns the values produced by expr_{1} otherwise returns the values produced by expr_{2}.
If the failure clause (// expr_{2}) is omitted and expr_{0} fails, the entire expression fails.
If the success clause (=> expr_{1}) is omitted and expr_{0} succeeds, the entire expression fails.

Creates a new scope for the evaluation of each declaration decl and each expression expr. The block expression produces the value(s) of the last expression in the block. A block expression can contain a RECV expression for handling message.

For each i = 1, ..., k: binds id_{i} to the value of expr_{i} and produces the values produced by expr. If expr_{i} produces an assignable reference, then id_{i} will be assignable.

Normally, an expression of the form id_{1}.id_{2} denotes the variable/constant id_{2} imported from the module id_{1}. However, if id_{1} is not a constant then a runtime call to :"." is made. Thus expr_{1}.expr_{2} is equivalent to :"."(expr_{1}, expr_{2}) except when expr_{2} is an identifier, in which case expr_{1}.id_{2} is equivalent to :"."(expr_{1}, "id_{2}").

Repeatedly evaluates expr.

For each value produced by expr_{0} evaluates expr_{1}.

Causes the current loop to start its next iteration.

Exits the current loop with the value(s) of expr. Note that expr is evaluated in the context directly outside the loop, in particular this affects STEP, EXIT and SEND expressions.

WHILE expr is equivalent to expr // EXIT NIL.

UNTIL expr is equivalent to expr => EXIT NIL.

For each value produced by expr_{1}, produces all the values of expr_{2}. If expr_{1} fails then the entire expression fails, thus expr_{1} & expr_{2} behaves like a shortcut *logical and* expression which returns it's second operand if it succeeds.

For each value V produced by expr_{1}, produces V for each value produced by expr_{2}. Within the evaluation of expr_{2} the special variable $ can be used to refer to the value produced by expr_{1}, thus expr_{1} \ expr_{2} can be used to mean "such that".

Produces all the values produced by expr_{1} followed by the values produced by expr_{2}. Since expr_{1} | expr_{2} will produce a value if either expr_{1} or expr_{2} succeeds, it behaves like a shortcut *logical or* expression.

Causes expr_{1} and expr_{2} to produce values in parallel: for each value produced by expr_{1} the next value produced by expr_{2} is returned. The expression fails when either expr_{1} or expr_{2} fails.

Generates the values produced by expr_{1}, expr_{2}, ..., expr_{k} in an interleaved fashion; i.e. the first value produced by expr_{1} is produced, followed the first from expr_{2} and so on until the first value from expr_{k} is produced. Then the second value from expr_{1} is produced, then the second from expr_{2} and so on. The expression fails when any of expr_{1}, expr_{2}, ..., expr_{k} fail.

Produces the first expr_{1} values produced by expr_{2}.

Produces all but the first expr_{1} values produced by expr_{2}.

Generate all the values of expr repeatedly. If expr fails to produce any values, then the entire expression fails.

Returns the sum of the values produced by expr. Fails if expr fails to produce any values.

Returns the product of the values produced by expr. Fails if expr fails to produce any values.

Returns the number of values produced by expr. Returns 0 if expr fails to produce any values.

Returns an instance of Std.Function.IteratorT which produces the values produced by expr.

Returns the next value produced by expr which should be an instance of Std.Function.IteratorT.

Catches messages sent in the current block. The message sent is assigned to id and value(s) produced by expr is returned as the value of the block. Note that RECV expressions receive all messages, it is therefore necessary to resend unhandled messages using SEND.

Sends expr as a message. The first enclosing (at runtime) RECV expr will receive the message.

Produces the value of expr as evaluated at compile time. If expr fails or sends msg at compile time, then `expr` is equivalent to BACK or SEND msg respectively. Since expr is evaluted at compile time, it may only use constants and global variables.