Perl6 Loop Constructs(use.perl.org)
use.perl.org
Perl6 Loop Constructs
http://use.perl.org/~masak/journal/40442?from=rss
11 comments
This kind of stuff is why I love Perl. I just wish I still had an excuse to use it on a daily basis...
The "repeat while EXPR { ... }" seems kinda goofy that it still evaluates after the loop runs once.
Not if you think of it as "do this but repeat while EXPR"
EDIT: Perhaps renaming it to "again while EXPR { ... }" would be a better option.
EDIT: Perhaps renaming it to "again while EXPR { ... }" would be a better option.
I don't think so. The first evaluation of the body is a given, the "repeat" means to do it more times while the EXPR is true.
It just seems like "repeat while EXPR { ... }" would check EXPR before the loop and the other order "repeat { ... } while EXPR" would check check the EXPR after each loop. Not a big deal, but just kinda goofy (as in ordering doesn't mean evaluation ordering).
I disagree. The truth value of the EXPR determines whether you repeat, meaning do an additional time. I agree that it may not be the immediate interpretation, but I think the vocabulary makes sense.
Except that 'repeat' in English doesn't always mean to do something an additional time. For example, "Repeat this task three times," means to do a task three times, not four, unless specified by the context.
On the plus side, since Perl 6's spec is not set in stone; goofy things like that can still be gotten rid of.
Yes; just go to the #perl6 channel on freenode, request a commit bit, and edit it out of the spec.
For this particular change though, I think you will meet a bit of resistance. Many people might agree that the feature is goofy, but few will probably agree that it's bad and should be gotten rid of.
For this particular change though, I think you will meet a bit of resistance. Many people might agree that the feature is goofy, but few will probably agree that it's bad and should be gotten rid of.