Content deleted Content added
m →Literature survey and conclusion: in print |
m Maintain {{WPBS}} and vital articles: 1 WikiProject template. Create {{WPBS}}. Keep majority rating "C" in {{WPBS}}. Remove 1 same rating as {{WPBS}} in {{WikiProject Computer science}}. Tag: |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1:
{{WikiProject banner shell|class=C|
{{WikiProject Computer science|importance=low}}
}}
==Cleanup==
Line 56 ⟶ 59:
This notion is virtually unheard of in print, but it does appear in two ''very recent'' C# books [http://books.google.com/books?q=%22anonymous+recursion%22&btnG=Search+Books], as well as some [[MSDN]] blogs, e.g. [http://blogs.msdn.com/wesdyer/archive/2007/02/02/anonymous-recursion-in-c.aspx]. But note how the author of that blog concludes that he simply rediscovered the Y combinator! So, this is worth no more than a little mention in the [[fixed point combinator]] article. [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 18:03, 21 August 2009 (UTC)
== Expand to full article ==
This article was previously a redirect (from merge) to [[fixed-point combinator]]. However, that is a very technical article with largely different subject, and in that context “anonymous recursion” is at best an occasional term, at worst an abuse of language.
However, anonymous recursion is a legitimate distinct topic – calling a function without using its name – and is possible without the technical machinery of a fixed-point combinator, simply by exposing the current context to programs. This is notably used in JavaScript and Perl, at least.
I’ve accordingly expanded this page into a proper article – hope it looks good, and please improve it!
:—Nils von Barth ([[User:Nbarth|nbarth]]) ([[User talk:Nbarth|talk]]) 06:02, 27 April 2013 (UTC)
== Simpler solution ==
I came up with a simpler lambda calculus solution for factorial. All I did was take the anonymous recursion version, and replace "lambda a, b" with "lambda a: lambda b:", and "(a, b)" with "(a)(b)".
<syntaxhighlight lang=python>
(lambda f: lambda x: f(f)(x)) \
(lambda f: lambda x: 1 if x == 0 else x * f(f)(x-1))
</syntaxhighlight>
But, this is original research I guess, so I won't put it on the page. Also the existing explanation might help people trying to understand the Y combinator. <small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/15.203.233.79|15.203.233.79]] ([[User talk:15.203.233.79|talk]]) 22:19, 27 April 2015 (UTC)</small><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
|