It's time yet again for me to throw more shite into the list to stir up some
discussion. Last time I did this I was told (off list) that I was making a
fool of myself. Well, so be it, it's not like I'm killing any trees (unless
of course, someone out there is filtering their Boston.pm email to /dev/lp
but you can't pin that on me!)... discussion lists are for discussion, so
let's discuss...


*Sniff* *Sniff* poor Larry, he actually did some work while on his cruise. I
feel for him, really, I do.

As you can probably tell, I just got around to reading Apocolypse 4. (What
can I say, job searching puts me behind in my news... but I'd rather be able
to buy pretzels than hear about the fact that Bush doesn't know how to chew
his!)

I'm a bit sad about seeing "do {} while CONDITION" getting the old boot in
Perl6. I've actually come to like it. But thankfully we won't have to use
(and break out of) that atrocious infinate "for (;;){}" loop (which I've
always thought of as a cheesy hack).

Instead we're getting:

loop {
    ...
    last unless CONDITION;
}

Which is something I can live with since that horrible pillbox isn't there.
The only thing good about that (;;) is that it proved once and for all that
Larry is in fact human.

It's funny, in Apoc4 he says that "do {} while" is seldom used and often
misunderstood. Ok, so maybe it's misunderstood, but that's only because it's
seldom used. (Whew, now there's an infinate loop for you!) Anyway, I came
across a program the other day where the author actually wrote something to
the effect:

if ($infinate) {
    while(1) {
        some_sub();
    }
}
else {
    some_sub();
}

If that's not a perfect cadidate for...

do { some_sub() } while $infinate;

or in Perl6 speak:
loop { some_sub(); last unless $infinate }


I don't know what is.

And while we're on the subject of loops. I personally have always used
"foreach" when I mean "foreach" and "for" when I mean "for". I can't think
of a single time that I've actually written "for" when I meant "foreach"
(outside of a oneliner). So now were getting "loop" to replace "for" which
is really just a lazy replacement for "foreach" for most people.

Still with me? Good.

Interstingly, the reason Larry gives for replacing "for" with "loop" is
"syntatic ambiguities", which is what I just said; people use "for" when
they mean "foreach" (Probably because they can!). Anyone have a good reason
why people aren't just forced to write "foreach" when they mean "foreach"
(and maybe throw in "fore" in an attempt to quiet complaints about 4 extra
characters)?


Matthew


Reply via email to