CompoundExpression

expr1;expr2;

evaluates the expri in turn, giving the last one as the result.

Details

  • CompoundExpression evaluates its arguments in a sequence corresponding to the control flow.
  • The returned value can be the result of Return[expr].
  • The evaluation of the expri can be affected by Return, Throw, and Goto.
  • expr1;expr2; returns value Null. If it is given as input, the resulting output will not be printed. Out[n] will nevertheless be assigned to be the value of expr2.

Examples

open allclose all

Basic Examples  (3)

Do a computation, but do not print its output:

% is still set to be the output:

Scope  (1)

Use Throw, Catch to exit immediately:

Introduced in 1988
 (1.0)