in reply to Re: Useful uses of redo?
in thread Useful uses of redo?

I guess you can do:

{ # do { stmt; stmt; stmt; redo if $cond; # } while ($cond); }

and

{ # repeat { stmt; stmt; stmt; redo unless $cond; # } until ($cond); }

but why? yuck! It's like saying that while loops while henceforth be like:

{ last unless $cond; # while ($cond) stmt; stmt; stmt; redo; # wend }

Replies are listed 'Best First'.
Re^3: Useful uses of redo?
by wolv (Pilgrim) on Aug 26, 2004 at 21:28 UTC
    do { } still exists. It's just the statement-modifier while-on-do that is taken away.
      So are you saying that in perl6 the following won't be valid:
      do {
          $foo = foo();
          $bar = bar();
      } while ($foo != $bar);
      ?? That would suck!

        Correct.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon