Glish provides C-style if and if else conditionals:
if ( expression ) statementAn if statement evaluates expression, converts the result to a boolean value, and if true executes statement. if else is similar, executing statement if the value is true and statement if false. expression should evaluate to a scalar value; if it is a vector then its first element is tested, though in the future an error may be generated instead.if ( expression ) statement else statement
As in most languages, a ``dangling-else" is associated with the nearest previous if, so
if ( x ) if ( y ) print "x and y" else print "either not x or not y"is interpreted as:
if ( x ) { if ( y ) print "x and y" else print "either not x or not y" }and not as:
if ( x ) { if ( y ) print "x and y" } else print "either not x or not y"