From: James Edward Gray II Date: 2007-02-14T03:04:40+09:00 Subject: Re: One-Liners (#113) On Feb 13, 2007, at 11:56 AM, Robert Dober wrote: > 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? Hmm, I wasn't aware of this. What makes you say that? James Edward Gray II