Closed skx closed 3 years ago
Currently our if support only allows blocks, like so:
if
if ( true ) { print( "FALSE\n"); } else { print( "FALSE\n"); }
This means if you want to chain you cannot write:
if ( 1 == 2 ) { print( "OK\n"); } else if ( 3 == 4 ) { print( "Meh?\n"); } else { print( "Moi!"); }
Instead you must nest things, like so:
if ( 1 == 2 ) { print( "OK\n"); } else { if ( 3 == 4 ) { print( "Meh?\n"); } else { print( "Moi!"); } }
We should allow the more natural approach to work.
Currently our
if
support only allows blocks, like so:This means if you want to chain you cannot write:
Instead you must nest things, like so:
We should allow the more natural approach to work.