Content deleted Content added
→Further examples: new section |
m →Some material: new section |
||
Line 61:
</source>
[[User:Subwy|Subwy]] ([[User talk:Subwy|talk]]) 10:58, 10 December 2008 (UTC)
== Some material ==
One really good demonstration of how the Y combinator works (it has enough hand waving to make the general principles accessible to the layman), is this:
let Y = (lambda (f)
((lambda (g) (f (g g)))
(lambda (g) (f (g g)))))
let H = (lambda (g) (f (g g))) for convenience
let fact = (Y fact-h)
fact
=> (Y fact-h)
=> (H H) ; with f = fact-h
=> (fact-h (g g))
=> (fact-h (H H))
= (fact-h (Y fact-h))
= (fact-h fact)
;; => indicates a substitution step, while = indicates an equivalence
;; which is not actually a substitution
Unfortunately, this uses a lispy syntax, which most people are not familiar with. We should work this into something that could go into the article. — <span style="font-variant:small-caps;font-family:sans-serif;">[[User:Edward Z. Yang|Edward Z. Yang]]</span><sup style="font-family:serif;">([[User talk:Edward Z. Yang|Talk]])</sup> 06:23, 29 January 2009 (UTC)
|