y-combinator in javascript
On Monday I was discussing the y combinator at Rossi’s. The next morning I wrote an example in scheme to send to my friends, but they don’t speak scheme. Sadly, this is tricky to write in python because of the lack of multi-line lambdas, but it’s damned easy in javascript:
|
|
See, there’s something to love about every language. And the beauty of this example is that you can probably type it write into the javascript console of you browser. REPL included.