The fundamental conditional operator in Arc is if
. It is similar to the Lisp if
, except it eliminates the parentheses around the clauses. For a simple conditional with multiple body statements, when
or its opposite unless
can be used.
Arc provides several conditionals that assign the test expression to a variable, similar to let
. The iflet
, caselet
, and whenlet
macros are useful if the test expression is used inside the body.