From: Christian Neukirchen Date: 2006-09-08T02:48:39+09:00 Subject: Re: Binary Search Using Lambda Logan Capaldo writes: > On Sep 7, 2006, at 9:39 AM, Christian Neukirchen wrote: > >> >> I can't resist from using the Y combinator: >> >> Y = lambda { |f| >> g = lambda { |h| >> lambda { |x| >> f[h[h]][x] >> } >> } >> g[g] >> } > > Sweet! Y-Combinator in ruby. You do realize, now that you've done the > "hard part" what this will do to advance the state of the art in ruby > obfuscation? *yawn*. BTDT: -rw-rw-r-- 1 chris chris 222 Oct 25 2003 /Users/chris/projects/ruby/y.rb -rw-rw-r-- 1 chris chris 285 Oct 25 2003 /Users/chris/projects/ruby/jarh2.rb s=",GreEkcaSh BODybuILDER ALBreChtAMMOonIa tSUNEMATsuJ"; puts lambda{|f|h=lambda{|h|lambda{|x|f[h[h]][x]}};h[h]}[ lambda{|f|lambda do|h|h[0]?f[h[1..-1]]< http://chneukirchen.org