Mark J. Reed wrote:
> Mark J. Reed wrote:
>> loop
>> {
>>   doSomething();
>>   last unless someCondition();
>>   doSomethingElse();
>> }
>
> That is, of course, merely the while(1) version from Aristotle's
> original message rewritten with Perl 6's loop keyword.  As I said, I'm
> OK with that, personally, but it's clearly not what he's looking for.

But maybe it is.  I suspect that the difficulty with the while(1)
version was the kludgey syntax; the loop syntax that you describe does
the same thing (i.e., putting the test in the middle of the loop block
instead of at the start or end of it), but in a much more elegant
manner.  The only thing that it doesn't do that a more traditional
loop construct manages is to make the loop condition stand out
visually.

-- 
Jonathan "Dataweaver" Lang

Reply via email to