* Jon Lang <datawea...@gmail.com> [2008-12-19 03:50]:
> Personally, it doesn’t strike me as being as straightforward
> as putting a “last unless” clause into the middle of an
> otherwise-infinite loop

You have to keep more state in your head to read

    while(1) {
        # ...
        last if $foo;
    }

than to read

    while($foo) {
        # ...
    }

The goto in the code I gave happens just once and doesn’t modify
the loop semantics. Basically, any one point in the code I gave
can be read in isolation, and is “locally complete” (I don’t know
how to say this better), whereas in the infinite loop the overall
effect of certain points is depenent on other points.

In Schwern’s terms, goto’ing into the middle of a terminating
loop is more skimmable than last’ing out of the middle of an
infinite loop.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to