A clear definition of the Y combinator in 28 words

There are some corners of Computer Science that are so esoteric that descriptions of them don't make sense on first reading (or even the hundredth reading)—for example, the Y combinator [1]. That's why I always treasure crystal clear explanations like this one:

If you have a language that supports anonymous lambda functions, there may be occasions where you want to build a recursive lambda. The Y Combinator specifically enables this.
If you don't like the Y Combinator for some reason, you can always make sure that your recursive functions are always named, but it's often convenient to declare lambdas in place instead of naming them, and this is no less true of recursive lambdas.

“Y Combinator in Python [2]”

(Don't let the term “anonymous lambda function” trip you up—all that means is a function (or subroutine if you will) that doesn't have a name)

I also find it amusing that while Lisp (generally considered one of the highest programming languages in existence) requires the Y combinator [3] (if that link is too obtuse, how about a page about Lamba Calculus [4]? Okay, that's obtuse as well), Forth [5], a language originally developed to control radio telescopes and has a history of being rather low level, doesn't need the Y combinator! You can write anonymous lambda functions all day in Forth with no problem (yes, I'm easily amused).

[1] http://en.wikipedia.org/wiki/Y_combinator

[2] http://programming.reddit.com/info/2k4eh/comments/c2k6f2

[3] http://www.t3x.org/sketchy/vol1/sl21.html

[4] http://www.mactech.com/articles/mactech/Vol.07/07.05/LambdaCalculus/

[5] http://en.wikipedia.org/wiki/Forth_(programming_language)

Gemini Mention this post

Contact the author