,, _exprseq

Expression sequences

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

object1, object2, ...
_exprseq(object1, object2, …)

Description

The function call _exprseq(object1, object2, ...) is the internal representation of the expression sequence object1, object2, ....

In MuPAD®, "sequences" are ordered collections of objects separated by commas. You may think of the comma as an operator that concatenates sequences. Internally, sequences are represented as function calls _exprseq(object1, object2, ...). On the screen, sequences are printed as object1, object2, ....

_exprseq() and the equivalent call null() yield the void object of type DOM_NULL.

When evaluating an expression sequence, all void objects of type DOM_NULL are removed from it, automatically.

The $ operator is a useful tool for generating sequences.

When a MuPAD function or procedure is called with more than one argument, the parameters are passed as an expression sequence.

Examples

Example 1

A sequence is generated by "concatenating" objects with commas. The resulting object is of type "_exprseq":

a, b, sin(x)

op(%, 0), type(%)

On the screen, _exprseq just returns its argument sequence:

_exprseq(1, 2, x^2 + 5) = (1, 2, x^2 + 5)

Example 2

The object of domain DOM_NULL (the "empty sequence") is automatically removed from expression sequences:

1, 2, null(), 3

Expression sequences are flattened. The following sequence does not have 2 operands, where the second operand is a sequence. Instead, it is flattened to a sequence with 3 operands:

x := 1: y := 2, 3: x, y

delete x, y:

Example 3

Sequences are used to build sets and lists. Sequences can also be passed to functions that accept several arguments:

s := 1, 2, 3: {s}, [s], f(s)

delete s:

Parameters

object1, object2, …

Arbitrary MuPAD objects

Return Values

Expression of type "_exprseq" or the void object of type DOM_NULL.

See Also

MuPAD Functions

Was this topic helpful?