## `_exprseq` -- expression sequences

#### Introduction

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

#### Call(s)

`object1, object2, ...` `_exprseq(object1, object2...)`

#### Parameters

`object1, object2, ...` | - | arbitrary MuPAD objects

#### Returns

an expression of type `"_exprseq"` or the void object of type `DOM_NULL`.

#### Related Functions

`_stmtseq`, `null`

#### Details

- 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.
- `_exprseq` is a function of the system kernel.

#### Example 1

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

    >> a, b, sin(x)

                                   a, b, sin(x)

    >> op(%, 0), type(%)

                               _exprseq, "_exprseq"

On the screen, `_exprseq` just returns its argument sequence:

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

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

#### Example 2

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

    >> 1, 2, null(), 3

                                      1, 2, 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

                                      1, 2, 3

    >> 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)

                         {1, 2, 3}, [1, 2, 3], f(1, 2, 3)

    >> delete s:

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000