|
General Details
|
|
Scheme
|
|
Posted 333 Days Ago
|
|
253 Views
|
|
Received 1 Rating
|
|
Recursive Lambdas with the Y and U Combinator
Description
In scheme you meet recursion almost anywhere. It's a natural thing, that can be naturally expressed in this language. There is one exception though. I'm talking of lambdas, that are by nature anonymous
and thus have no name that could be used to call itself, thus recursively calling itself.
The lambda-calculus however shows that it is indeed possible to do such things.
The code that is presented here is nothing new, and widely known among the lispers but
it may be interesting for any of you who didn't yet get in touch with the language too much.
For those of you who want to know the formal definition of the Y-Combinator, here it is:
Y = λf.(λx.f (x x)) (λx.f (x x))
For further information and a more indepth explanation see: http://www.ece.uc.edu/~franco/C511/html/Scheme/ycomb.html
Source Code
Comments
| Please login to post comments. |
More "Scheme" Source Codes By This Author
Recently Posted "Scheme" Source Codes
Recently Rated "Scheme" Source Codes
|