Use only in the MuPAD Notebook Interface.

Syntax

Description

blockIdents(S)(a) creates a transparent block
which is evaluated like a, except that the identifiers
in S are neither substituted by their values nor
are their properties used.

blockIdents is a parametrized family of domains,
depending on a parameter S which must be a set.
If d is any block domain, d(a) creates
a block belonging to that domain, with content a.

blockIdents(S)(a) replaces all identifiers
in a that belong to S by newly
created identifiers, evaluates the result and substitutes back; the
final result is put into a block. In order to evaluate a normally
before putting it into a block, useeval(hold(blockIdents(S))(a)).

Blocks of type blockIdents(S) are evaluated
in the same way as their contents at the time of creation (see above).

Blocks of type blockIndents(S) have the same
operands as their content.

Sequences can also be put into blocks.

You can create further block domains using inheritance. This
particularly useful for creating own evaluate or testtype methods.
See Example 6.

The call expr(b) replaces
all transparent blocks in b by their content, without
evaluating that content.

In case of nested blocks, only the outermost block is removed
by both expr and unblock.

Examples

Example 1

A block is a sort of container that protects its content against
evaluation:

y:= 1: bl:= block(1+y)

Blocks are atomic; thus y and 1 are
not visible as operands:

op(bl), nops(bl)

Although blocks are not arithmetical expressions, some basic
arithmetical operations are defined for them:

collect(x+bl+x*bl, bl);
delete y, bl:

Example 2

Transparent blocks protect against evaluation, too:

y:= 2:
bl:=blockTransparent(x+y+z)

However, a transparent block allows access to the operands of
its content:

op(bl,1), subs(bl, hold(y) = y)

delete bl, y:

Example 3

With a third kind of block, suppressing evaluation may be limited
to certain identifiers: