{
# body
redo
if ...;
# tail
}
# post
# vs
TOP:
# body
goto TOP
if ...;
# tail
# post
####
{
# body
redo
if ...;
}
# post
# becomes:
do {
# body
} until( ! ... );
# post
####
# bare block "loop":
{
# head
last
if ...;
# body
}
# post
# vs goto:
# top?
# head
goto END
if ...;
# body
END:
# post
# vs if:
# head
if( ! ... ) {
# body
}
# post
####
{
# top
last
if ...;
# middle
redo
if ...;
# tail
}
# post
TOP:
# top
goto END
if ...;
# middle
goto TOP
if ...;
# tail
END:
# post
####
LOOP: {
try something;
if (!success) {
wait;
redo;
}
}
# becomes:
while( 1 ) {
try something;
last
if failed;
sleep $seconds;
}
####
while( ! try_something() ) {
sleep $seconds;
}