From: Robert Dober Date: 2007-02-14T02:56:11+09:00 Subject: Re: One-Liners (#113) ------=_Part_86388_20605457.1171389368901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/13/07, James Edward Gray II wrote: > > On Feb 13, 2007, at 11:10 AM, Ken Bloom wrote: > > >>>> Hash.new{|h, n| n==1 ? [1] : [n] + h[n%2 == 0 ? n/2 : n*3+1] } > >>>> [quiz] > >>> Kudos on the memoizing wondrous number, btw. :) > >> It's not actually. I never assign the Hash value. ;) > > > > So it's equivalent to: > > (h=lambda {|n| n==1 ? [1] : [n] + h[n%2 == 0 ? n/2 : n*3+1] })[23] > > Exactly. > > James Edward Gray II That really puts the spotlight on it, this will go away in 2.0 though if I understand correctly :) and one would need to write: (h=lambda {|n,lmb| n==1 ? [1] : [n] + h[n%2 == 0 ? n/2 : n*3+1,lmb] })[23,h] is that right? Robert -- We have not succeeded in answering all of our questions. In fact, in some ways, we are more confused than ever. But we feel we are confused on a higher level and about more important things. -Anonymous ------=_Part_86388_20605457.1171389368901--