Control statements
Like most programming languages, Symja has common control statements for conditions, loops, etc.:
returns
pos
ifcond
evaluates toTrue
, and neg if it evaluates toFalse
.
yields
expr1
ifcond1
evaluates toTrue
,expr2
ifcond2
evaluates toTrue
, etc.
evaluates
expr
max
times, substitutingi
inexpr
with values from1
tomax
.
evaluates
start
, and then iterativelybody
andincr
as long astest
evaluates toTrue
.
evaluates
body
as long astest
evaluates toTrue
.
returns an expression with
f
appliedn
times toexpr
.
applies a function
f
repeatedly on an expressionexpr
, until applyingtest
on the result no longer yieldsTrue
.
starting with
expr
, repeatedly appliesf
until the result no longer changes.
Compound statements can be entered with ;
.
The result of a compound expression is its last part or Null
if it ends with a ;
.
Inside For
, While
, and Do
loops, Break()
exits the loop and Continue()
continues to the next iteration.