> 
> > 2) Is there anything like labels for iterators or loops?  This allows
> > you to do next, last, etc. on outside loops, like:
> > 
> >          loop1:   while x > 1
> >                        while y > 1
> >                            if t2 then next loop1
> >                        end
> >                   end
> > 
> > This could be emulated with a flag and an ugly if check, but I hope
> > not.
> 
> That sort of nonlocal control flow is done with catch/throw in Ruby.
> 
>         catch(:done)  do
>             while x > 1
>                 while y > 1
>                     if t2 then throw :done
>                 end
>             end
>         end
> 

Hmm... that does not seem quite correct, thou.

The throw() example above actually breaks from both loops.  That's not
the same as next, thou.

Given pseudo-code, like:

      catch(:arg) do
        while $stdin.getc != "a"
           begin                     
               p "A"                    
               while 1
                     p "B"
                     throw :arg if 1
               end
           ensure
               #do a lot of stuff here
               p "ensure"
           end
        end
      end

In the dummy example above, I want the loop to continue (thus, getting
a character, and printing "A","B","ensure" until "a" is typed).
The throw seems to just exit the loop.  If the catch is placed inside
the while, the getc condition is not run, then.

What's the right way?