※ 引述《noctem (noctem)》之铭言:
: ※ 引述《Etude ( )》之铭言:
: : fix = lambda {|f|
: : lambda {|x| f[lambda {|y| x[x][y]}]
: : }[lambda {|x| f[lambda {|y| x[x][y]}]}]
: : }
: : 推 noctem:出现了!XD 听说这东西叫做 Z combinator... 04/23 02:07
: : 推 kojilin:Y combinator!?想得出来的人真是... 04/23 18:18
: http://en.wikipedia.org/wiki/Y_combinator
: Wikipedia 上说这个叫做 Z combinator.
: Y combinator 则是 Y = \f . (\x . f (x x)) (\x . f (x x))
: 但 strict 的语言没法直接用 Y combinator.
: Y combinator 是 Curry 发现的. 後来还发现了一大堆 fixed-point
: combinators. 只能说这些人脑筋真好...
ohoh感谢
我是看这边
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/20469
Y = proc { |builder|
proc { |f| f.call(f) } \
.call ( proc { |f|
builder.call (proc { |x| f.call(f).call(x) }) })
}
这边是推Y-Combinator是这样
from "The Little Schemer" !?但是我没看过orz..
觉得这...连要看他推都很花脑力了~
koji
※ 编辑: kojilin 来自: 140.92.57.104 (04/24 10:28)