From: Paul Brannan Date: 2003-01-24T23:03:53+09:00 Subject: Re: Definition: iterator On Fri, Jan 24, 2003 at 08:29:11PM +0900, Bulat Ziganshin wrote: > technically speaking, it's a higher-order function, or functional > > it's not coroutine, because > 1) we can call block several times > 2) we can't return control from middle of block I don't understand what you mean. I believe that functions that take blocks meat both these criteria. def foo puts "1" yield puts "2" yield puts "3" yield end foo do puts "this is a test" next puts "you should not see this message" end [pbrannan@zaphod tmp]$ ruby foo.rb 1 this is a test 2 this is a test 3 this is a test Paul