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. ifif ( 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"