On Wed, 2013-11-06 at 08:34 +0100, Robert Klemme wrote:
> On Wed, Nov 6, 2013 at 1:40 AM, Stefan Salewski <mail / ssalewski.de>
> wrote:
> > On Tue, 2013-11-05 at 16:23 -0800, Justin Collins wrote:
> >> This is a block, just like any other block.
> >
> > Yes indeed -- in Ruby each loop is in first order a block,
> 
> Not each loop but #each loop. :-)
> 
> $ ruby -e 'for i in 0..5; j=i; puts i; end; puts "--", j'
> 0
> 1
> 2
> 3
> 4
> 5
> --
> 5
> 
> There is no block with a for loop.

Thanks for that important hint.
One point, which has confused me, is that blocks can be limited by {} or
a do/end pair. But for the for loop (also while and until loops I think)
the do/end keywords do not build a block.

Best regards

Stefan Salewski