From: Pat Maddox Date: 2007-11-14T09:20:35+09:00 Subject: Re: recursion with blocks On Nov 13, 2007 4:15 PM, James Edward Gray II wrote: > On Nov 13, 2007, at 6:01 PM, Mike Perham wrote: > > > You aren't actually recursing inside the block, > > just using the block as a conditional. I was trying to figure out how > > to recurse inside the block. > > Yeah, I was just using the block inside a recursive method. You are > right. > > Can you elaborate on what you mean by "recurse inside a block?" I'm > having trouble thinking of an example. > > James Edward Gray II > > I think he means something like this? fact = lambda {|val| return 1 if val <= 0; val * fact[val - 1] } fact[4] => 24 but I'm not sure... Pat