Re:Go + Services = One Goliath Project
by baddox on Saturday December 21, 2019 @11:05PM
(#21855111)
What comes to mind immediately is that you would lose the ability to `break` unless you had another convention like returning a specific value to indicate you want to break.
[ Parent
| on HN ]
Re:Go + Services = One Goliath Project
by lesserknowndan on Sunday December 22, 2019 @04:16AM
(#21856098)
If you are limited to one statement you could still do something along the lines of the following (no particular language):
foreach ( $item in $list )
{
if ( 1 == some_function( $item ) )
{
continue;
}
else
if ( 2 == some_function( $item ) )
{
break;
}
else
{
another_function( $item );
}
}
But I would immediately concede that it is starting to miss the entire point of why it was enforced in the first place...