On Wed, Nov 6, 2013 at 3:37 PM, Stefan Salewski <mail / ssalewski.de> wrote:
> 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.

Probably because there are no "do/end" keywords.

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/