Skip to content

Control Flow

32 built-in function(s) in this category.

  • $Epilog — $Epilog (Stable)
  • $Post — $Post (Stable)
  • $Pre — $Pre (Stable)
  • $PrePrint — $PrePrint (Stable)
  • $PreRead — $PreRead (Stable)
  • $RecursionLimit — $RecursionLimit (Stable)
  • Boole — Boole[expr] (Stable)
  • Break — Break[] exits the nearest enclosing Do, For, or While loop. (Stable)
  • Catch — Catch[expr] (Stable)
  • Check — Check[expr, failexpr] returns failexpr if a message is generated while evaluating expr, otherwise the value of expr. (Stable)
  • Compile — Compile[{x, ...}, expr] or Compile[{{x, _Real}, ...}, expr] builds a CompiledFunction that evaluates expr over machine numbers (types _Real, _Integer, _Complex; default _Real), falling back to the interpreter for symbolic arguments or non-compilable bodies. With RuntimeAttributes -> Listable the object threads over List arguments; the default is RuntimeAttributes -> {}. RuntimeOptions -> {"CatchMachineIntegerOverflow" -> False} (or the shorthand RuntimeOptions -> "Speed") lets machine-integer arithmetic wrap instead of falling back to the interpreter, which is faster and gives a different answer from the interpreter once a result leaves the machine-integer range; the default True never does. WorkingPrecision -> n compiles real/complex arithmetic in MPFR at n decimal digits (one fixed precision for the whole function), for the straight-line arithmetic + elementary-function subset; MachinePrecision (the default) keeps the machine path unchanged. "BigIntegers" -> True makes integer arithmetic exact (GMP) instead of int64. (Stable)
  • CompileDiagnostics — CompileDiagnostics[argspec, expr] reports whether expr compiles for the given Compile[] argument specification, and if not, the innermost subexpression that could not be lowered. Accepts the same WorkingPrecision -> n / "BigIntegers" -> True options as Compile[], so it also reports whether the arbitrary-precision subset lowers (ResultType MPFRReal/MPFRComplex/BigInteger). For a compiled body it also gives the result type and the instruction count with and without the optimiser. (Stable)
  • CompilePrint — CompilePrint[cf] prints the bytecode of the CompiledFunction cf: its argument and result registers with their types, the scalar/array/tile register banks, and one line per instruction giving both the raw operands and a readable rendering. For an object whose body did not compile it reports the bail reason instead. Returns Null. (Stable)
  • ConditionalExpression — ConditionalExpression[expr, cond] (Stable)
  • Continue — Continue[] proceeds to the next iteration of the nearest enclosing Do, For, or While loop. (Stable)
  • Do — Do[expr, n] evaluates expr n times. (Stable)
  • Equivalent — Equivalent[e1, e2, ...] (Stable)
  • For — For[start, test, incr, body] executes start, then repeatedly evaluates body and incr until test fails to give True. (Stable)
  • Goto — Goto[tag] (Stable)
  • If — If[cond, t] (Stable)
  • Implies — Implies[p, q] (Stable)
  • Label — Label[tag] (Stable)
  • Message — Message[sym::tag, args] prints the named message unless messages are suppressed. (Stable)
  • Piecewise — Piecewise[{{val_1, cond_1}, {val_2, cond_2}, ...}] (Stable)
  • Quiet — Quiet[expr] evaluates expr with messages suppressed and returns its value. Quiet[expr, spec] suppresses all messages regardless of spec. (Stable)
  • Return — Return[expr] (Stable)
  • Switch — Switch[expr, form_1, value_1, form_2, value_2, ...] (Stable)
  • Throw — Throw[value] (Stable)
  • TrueQ — TrueQ[expr] yields True if expr is True, and False otherwise. (Stable)
  • Which — Which[test1, value1, test2, value2, ...] (Stable)
  • While — While[test, body] evaluates test, then body, repeatedly, until test first fails to give True. (Stable)
  • Xor — Xor[e1, e2, ...] (Stable)