* Mike Stay <metaweta@gmail.com> [Apr 24. 2014 18:44]:
On Thu, Apr 24, 2014 at 6:21 AM, Joerg Arndt <arndt@jjj.de> wrote:
* Robert Smith <quad@symbo1ics.com> [Apr 24. 2014 14:09]:
I think he was referring to the C++, not the combinator. :)
Actually both, but foremost the combinator. I tried to get the gist of the things in the past and consistently failed.
Lambdas are sometimes called "anonymous" functions because they don't have names. Without a name, it becomes tricky to do recursion. One idea is to write your code twice (what follows is javascript):
((f) => (n) => { if (n === 0) return 1 else return n * f(f)(n-1) }) ((f) => (n) => { if (n === 0) return 1 else return n * f(f)(n-1) })
This takes the first code block and applies it to the second one, and since f is bound to one of these code blocks, f(f) is the same as the code above.
Thanks! I do understand what you said and feel less dumb now. I wish the Wiki page would say something to that effect.
The Y combinator handles the duplication for you so you only have to write the code once. Of course, any modern language allows names for functions, so it's pretty much useless unless you're trying to explain some of the finer points of the Curry-Howard isomorphism.
The *what*? (don't try, I will not understand). Best regards, Joerg
-- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun