From: Simon Krahnke Date: 2009-10-01T19:05:13+09:00 Subject: Re: SystemStackError: stack level too deep > how make it deeper? * Tony Arcieri (05:25) schrieb: > [Note: parts of this message were removed to make it a legal post.] > > On Wed, Sep 30, 2009 at 1:55 PM, Jason Roelofs wrote: > >> Rewrite it to not be recursive. > > That advice is about as useful as "Rewrite it in a language other than Ruby" But it's the only answer there is. Unrecognized tail recursion will kill every stack. def find_next_match(p, h) loop do result_p = p(p + 1) result_h = h(h + 1) if result_p == result_h # result found! return result_p if result_p < result_h p += 1 else h += 1 end puts "find next match for p=#{p} (#{result_p}) and h=#{h} (#{result_h})" end end mfg, simon .... not tried