Recursions without names: Introduction to the Y combinator in JavaScript
21–30 of 33 posts
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#22To be fair, the article would be more aptly titled "Recursion without function names". In any recursion you need a way to reference the original function somehow. They're using a function parameter to accomplish that via indirection.
No 'x=...'
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#23Nerd -> meet article
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#24I find the Python implementation is slightly more elegant: (lambda f: f(f)) (lambda fn: lambda n: 1 if n == 0 else (n * fn(fn)(n - 1))) (5)
Yeah. But I didn't find a way to run python code in the browser. Currently in Klipse, we support javascript, ruby, clojure and php...
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#25Earlier quoted context omitted.
Yeah. But I didn't find a way to run python code in the browser. Currently in Klipse, we support javascript, ruby, clojure and php...
I did not know there was a Ruby to JS compiler. That's __really__ fascinating! Do you have plans to support Python any time soon?
If you find a way to evaluate python code in the browser, please let me know: viebel@gmail.com
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#26Earlier quoted context omitted.
Quoth xkcd, "Tail recusion is its own reward." In all seriousness, even if the y combinator is practically useless in languages that don't have proper TCO (which is specced for ES7), it's a useful learning tool, is powerfully mind expanding, and can help to demonstrate the power of the λ-calculus.
Is the Y-combinator any more or less dependent on TCO than regular recursion? The Y combinator is useless in languages that already have builtin support for recursive functions.
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#27Earlier quoted context omitted.
I did not know there was a Ruby to JS compiler. That's __really__ fascinating! Do you have plans to support Python any time soon?
I'd love to support python. If you find a way to evaluate python code in the browser, please let me know: viebel@gmail.com
> Skulpt is a Javascript implementation of Python 2.x. Python that runs in your browser!
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#28For what purpose?
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#29Earlier quoted context omitted.
I'd love to support python. If you find a way to evaluate python code in the browser, please let me know: viebel@gmail.com
Perhaps `skulpt`? > Skulpt is a Javascript implementation of Python 2.x. Python that runs in your browser! [0] https://github.com/skulpt/skulpt
Re: Recursions without names: Introduction to the Y combinator in JavaScript
#30To be fair, the article would be more aptly titled "Recursion without function names". In any recursion you need a way to reference the original function somehow. They're using a function parameter to accomplish that via indirection.
There are no names except function arguments. No 'x=...'