[ruby-talk:00310] help: iterator..

From: Pros Yeboah <yeboah@...>
Date: 1999-05-14 06:31:43 UTC
List: ruby-talk #310
Hi
I have a problem .

How  do one  pass the one pass the block of an iterator recursively
further.
eg.
def  foo(bar)
if bar  <= 0; "baz"
 else  foo(bar-=1) ????   # ??? ==>  the passed iterator block
end
end

foo is supposed to be called  with  foo(something){block}.

1) I don't want to use a Proc Object as a parameter.
2) How can one refer to the object for the iterator block ?

thanks,
Pros

In This Thread

Prev Next