Knowledge

Anonymous recursion

Source ๐Ÿ“

46:, which provides reflection facilities to support it. In general programming practice, however, this is considered poor style, and recursion with named functions is suggested instead. Anonymous recursion via explicitly passing functions as arguments is possible in any language that supports functions as arguments, though this is rarely used in practice, as it is longer and less clear than explicitly recursing by name. 343:
Even without mechanisms to refer to the current function or calling function, anonymous recursion is possible in a language that allows functions as arguments. This is done by adding another parameter to the basic recursive function and using this parameter as the function for the recursive call.
133:
The usual alternative is to use named functions and named recursion. Given an anonymous function, this can be done either by binding a name to the function, as in named function expressions in JavaScript, or by assigning the function to a variable and then calling the variable, as in function
352:
to this higher order function. This is mainly of academic interest, particularly to show that the lambda calculus has recursion, as the resulting expression is significantly more complicated than the original named recursive function. Conversely, the use of fixed-pointed combinators may be
134:
statements in JavaScript. Since languages that allow anonymous functions generally allow assigning these functions to variables (if not first-class functions), many languages do not provide a way to refer to the function itself, and explicitly reject anonymous recursion; examples include
115:
Anonymous recursion can also be used for named functions, rather that calling them by name, say to specify that one is recursing on the current function, or to allow one to rename the function without needing to change the name where it calls itself. However, as a matter of
49:
In theoretical computer science, anonymous recursion is important, as it shows that one can implement recursion without requiring named functions. This is particularly important for the
39:
features which allow one to access certain functions depending on the current context, especially "the current function" or sometimes "the calling function of the current function".
426:
Using a higher-order function so the top-level function recurses anonymously on an argument, but still needing the standard recursive function as an argument:
53:, which has anonymous unary functions, but is able to compute any recursive function. This anonymous recursion can be produced generically via 2729: 36: 977:
First make the higher-order function of two variables be a function of a single variable, which directly returns a function, by
74: 1827:
Combining these yields a recursive definition of the factorial in lambda calculus (anonymous functions of a single variable):
2743:, February 02, 2007, contains a substantially similar example found in the book above, but accompanied by more discussion. 353:
generically referred to as "anonymous recursion", as this is a notable use of them, though they have other applications.
28: 109: 105: 2014: 348:
allows anonymous recursion within the actual recursive function. This can be done purely anonymously by applying a
70: 2740: 2292:
outside a subroutine. This allows anonymous recursion, such as in the following implementation of the factorial:
135: 2413: 92:
is possible, such as by calling "the caller (the previous function)", or, more rarely, by going further up the
1410: 972: 349: 54: 2800: 2714: 702: 32: 141:
For example, in JavaScript the factorial function can be defined via anonymous recursion as such:
31:
which does not explicitly call a function by name. This can be done either explicitly, by using a
2838: 592:
We can eliminate the standard recursive function by passing the function argument into the call:
89: 66: 2755: 2725: 1091: 707: 117: 97: 85: 20: 84:
Anonymous recursion primarily consists of calling "the current function", which results in
967: 50: 101: 2832: 2681:
Issue 226: It's impossible to recurse a anonymous function in Go without workarounds.
2680: 2175:. These allow anonymous recursion, such as in this implementation of the factorial: 2025:. This allows anonymous recursion, such as in this implementation of the factorial: 78: 2733: 2783: 2767: 2517:
It will not work, however, if passed as an argument to another function, e.g.
2164: 93: 43: 1081:
There are two "applying a higher order function to itself" operations here:
970:, which only uses functions of a single variable, this can be done via the 356:
This is illustrated below using Python. First, a standard named recursion:
35:โ€“ passing in a function as an argument and calling it โ€“ or implicitly, via 978: 2816: 2812: 344:
This creates a higher-order function, and passing this higher function
2699:
Why was the arguments.callee.caller property deprecated in JavaScript?
2787: 2771: 2698: 2694: 2525:
can be used. For example, the code below squares a list recursively:
2817:
Get currently called function to write anonymous recursive function
1089:
in the second. Factoring out the second double application into a
65:
Anonymous recursion is primarily of use in allowing recursion for
2281: 2018: 42:
In programming practice, anonymous recursion is notably used in
2288:
token, which returns a reference to the current subroutine, or
104:
of "the current function" is a functional equivalent of the "
2521:, inside the anonymous function definition. In this case, 2788:
Can a lambda function call itself recursively in Python?
2772:
Can a lambda function call itself recursively in Python?
241:
Rewritten to use a named function expression yields:
2284:5.16, the current subroutine is accessible via the 1222:Factoring out the other double application yields: 1409:Combining the two combinators into one yields the 112:, allowing one to refer to the current context. 2171:, while the calling function is accessible via 701:The second line can be replaced by a generic 8: 16:Recursion without calling a function by name 2416:, the current function can be called using 2732:, p. 462โ€”463. Derived substantially from 2167:, the current function is accessible via 2690: 2688: 2717:, but it does appear in the following: 2673: 1627:Expanding out the Y combinator yields: 2713:This terminology appear to be largely 96:, and this can be chained to produce 7: 2123:โ applied to each element of 0 to 9 14: 339:Passing functions as arguments 69:, particularly when they form 1: 120:this is generally not done. 110:object-oriented programming 2855: 2697:by olliej, Oct 25 '08 to " 2801:The 'current_sub' feature 2756:Deriving the Y combinator 2741:Anonymous Recursion in C# 2736:'s blog (see next item). 2527: 2422: 2294: 2177: 2027: 1829: 1629: 1415: 1224: 1097: 983: 852: 713: 594: 428: 358: 243: 143: 55:fixed-point combinators 1085:in the first line and 350:fixed-point combinator 850:Written anonymously: 703:higher-order function 77:, to avoid having to 33:higher-order function 2768:Hugo Walter's answer 2758:, January 10th, 2008 2722:Accelerated C# 2008 67:anonymous functions 25:anonymous recursion 2803:", perldoc feature 2021:is accessible via 90:indirect recursion 2306:":5.16" 118:programming style 81:of the function. 2846: 2823: 2813:agstudy's answer 2810: 2804: 2797: 2791: 2781: 2775: 2765: 2759: 2752: 2746: 2724:, Apress, 2007, 2711: 2705: 2692: 2683: 2678: 2663: 2660: 2657: 2654: 2651: 2648: 2645: 2642: 2639: 2636: 2633: 2630: 2627: 2624: 2621: 2618: 2615: 2612: 2609: 2606: 2603: 2600: 2597: 2594: 2591: 2588: 2585: 2582: 2579: 2576: 2573: 2570: 2567: 2564: 2561: 2558: 2555: 2552: 2549: 2546: 2543: 2540: 2537: 2534: 2531: 2524: 2520: 2513: 2510: 2507: 2504: 2501: 2498: 2495: 2492: 2489: 2486: 2483: 2480: 2477: 2474: 2471: 2468: 2465: 2462: 2459: 2456: 2453: 2450: 2447: 2444: 2441: 2438: 2435: 2432: 2429: 2426: 2419: 2403: 2400: 2397: 2394: 2391: 2388: 2385: 2382: 2379: 2376: 2373: 2370: 2367: 2364: 2361: 2358: 2355: 2352: 2349: 2346: 2343: 2340: 2337: 2334: 2331: 2328: 2325: 2322: 2319: 2316: 2313: 2310: 2307: 2304: 2301: 2298: 2291: 2287: 2271: 2268: 2265: 2262: 2259: 2256: 2253: 2250: 2247: 2244: 2241: 2238: 2235: 2232: 2229: 2226: 2223: 2220: 2217: 2214: 2211: 2208: 2205: 2202: 2199: 2196: 2193: 2190: 2187: 2184: 2181: 2174: 2173:arguments.caller 2170: 2169:arguments.callee 2154: 2151: 2148: 2145: 2142: 2139: 2136: 2133: 2130: 2127: 2124: 2121: 2118: 2115: 2112: 2109: 2106: 2103: 2100: 2097: 2094: 2091: 2088: 2085: 2082: 2079: 2076: 2073: 2070: 2067: 2064: 2061: 2058: 2055: 2052: 2049: 2046: 2043: 2040: 2037: 2034: 2031: 2024: 1999: 1996: 1993: 1990: 1987: 1984: 1981: 1978: 1975: 1972: 1969: 1966: 1963: 1960: 1957: 1954: 1951: 1948: 1945: 1942: 1939: 1936: 1932: 1929: 1926: 1923: 1920: 1917: 1914: 1911: 1908: 1905: 1902: 1899: 1896: 1893: 1890: 1887: 1884: 1881: 1878: 1875: 1872: 1869: 1866: 1863: 1860: 1857: 1854: 1851: 1848: 1845: 1842: 1839: 1836: 1833: 1823: 1820: 1817: 1814: 1811: 1808: 1805: 1802: 1799: 1796: 1793: 1790: 1787: 1784: 1781: 1778: 1775: 1772: 1769: 1766: 1763: 1760: 1757: 1754: 1751: 1748: 1745: 1742: 1739: 1736: 1733: 1730: 1727: 1724: 1721: 1718: 1715: 1712: 1709: 1706: 1703: 1700: 1697: 1694: 1691:\ 1690: 1687: 1684: 1681: 1678: 1675: 1672: 1669: 1666: 1663: 1660: 1657: 1654: 1651: 1648: 1645: 1642: 1639: 1636: 1633: 1623: 1620: 1617: 1614: 1611: 1608: 1605: 1602: 1599: 1596: 1593: 1590: 1587: 1584: 1581: 1578: 1575: 1572: 1569: 1566: 1563: 1560: 1557: 1554: 1551: 1548: 1545: 1542: 1539: 1536: 1533: 1530: 1527: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1503: 1500: 1497: 1494: 1491: 1488: 1485: 1482: 1479: 1476: 1473: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1434: 1431: 1428: 1425: 1422: 1419: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1342: 1339: 1336: 1333: 1330: 1327: 1324: 1321: 1318: 1315: 1312: 1309: 1306: 1303: 1300: 1297: 1294: 1291: 1288: 1285: 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1218: 1215: 1212: 1209: 1206: 1203: 1200: 1197: 1194: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1167: 1164: 1161: 1158: 1155: 1152: 1149: 1146: 1143: 1140: 1137: 1134: 1131: 1128: 1125: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1088: 1084: 1077: 1074: 1071: 1068: 1065: 1062: 1059: 1056: 1053: 1050: 1047: 1044: 1041: 1038: 1035: 1032: 1029: 1026: 1023: 1020: 1017: 1014: 1011: 1008: 1005: 1002: 999: 996: 993: 990: 987: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 895: 892: 889: 886: 883: 880: 877: 874: 871: 868: 865: 862: 859: 856: 846: 843: 840: 837: 834: 831: 828: 825: 822: 819: 816: 813: 810: 807: 804: 801: 798: 795: 792: 789: 786: 783: 780: 777: 774: 771: 768: 765: 762: 759: 756: 753: 750: 747: 744: 741: 738: 735: 732: 729: 726: 723: 720: 717: 697: 694: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 588: 585: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 274: 271: 268: 265: 262: 259: 256: 253: 250: 247: 237: 234: 231: 228: 225: 222: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 174: 171: 168: 165: 162: 159: 156: 153: 150: 147: 98:mutual recursion 86:direct recursion 21:computer science 2854: 2853: 2849: 2848: 2847: 2845: 2844: 2843: 2829: 2828: 2827: 2826: 2811: 2807: 2798: 2794: 2782: 2778: 2766: 2762: 2753: 2749: 2712: 2708: 2693: 2686: 2679: 2675: 2670: 2665: 2664: 2661: 2658: 2655: 2652: 2649: 2646: 2643: 2640: 2637: 2634: 2631: 2628: 2625: 2622: 2619: 2616: 2613: 2610: 2607: 2604: 2601: 2598: 2595: 2592: 2589: 2586: 2583: 2580: 2577: 2574: 2571: 2568: 2565: 2562: 2559: 2556: 2553: 2550: 2547: 2544: 2541: 2538: 2535: 2532: 2529: 2523:sys.function(0) 2522: 2518: 2515: 2514: 2511: 2508: 2505: 2502: 2499: 2496: 2493: 2490: 2487: 2484: 2481: 2478: 2475: 2472: 2469: 2466: 2463: 2460: 2457: 2454: 2451: 2448: 2445: 2442: 2439: 2436: 2433: 2430: 2427: 2424: 2420:. For example, 2417: 2410: 2405: 2404: 2401: 2398: 2395: 2392: 2389: 2386: 2383: 2380: 2377: 2374: 2371: 2368: 2365: 2362: 2359: 2356: 2353: 2350: 2347: 2344: 2341: 2338: 2335: 2332: 2329: 2326: 2323: 2320: 2317: 2314: 2311: 2308: 2305: 2302: 2299: 2297:#!/usr/bin/perl 2296: 2289: 2285: 2278: 2273: 2272: 2269: 2266: 2263: 2260: 2257: 2254: 2251: 2248: 2245: 2242: 2239: 2236: 2233: 2230: 2227: 2224: 2221: 2218: 2215: 2212: 2209: 2206: 2203: 2200: 2197: 2194: 2191: 2188: 2185: 2182: 2179: 2172: 2168: 2161: 2156: 2155: 2152: 2149: 2146: 2143: 2140: 2137: 2134: 2131: 2128: 2125: 2122: 2119: 2116: 2113: 2110: 2107: 2104: 2101: 2098: 2095: 2092: 2089: 2086: 2083: 2080: 2077: 2074: 2071: 2068: 2065: 2062: 2059: 2056: 2053: 2050: 2047: 2044: 2041: 2038: 2035: 2032: 2029: 2022: 2011: 2006: 2001: 2000: 1997: 1994: 1991: 1988: 1985: 1982: 1979: 1976: 1973: 1970: 1967: 1964: 1961: 1958: 1955: 1952: 1949: 1946: 1943: 1940: 1937: 1934: 1930: 1927: 1924: 1921: 1918: 1915: 1912: 1909: 1906: 1903: 1900: 1897: 1894: 1891: 1888: 1885: 1882: 1879: 1876: 1873: 1870: 1867: 1864: 1861: 1858: 1855: 1852: 1849: 1846: 1843: 1840: 1837: 1834: 1831: 1825: 1824: 1821: 1818: 1815: 1812: 1809: 1806: 1803: 1800: 1797: 1794: 1791: 1788: 1785: 1782: 1779: 1776: 1773: 1770: 1767: 1764: 1761: 1758: 1755: 1752: 1749: 1746: 1743: 1740: 1737: 1734: 1731: 1728: 1725: 1722: 1719: 1716: 1713: 1710: 1707: 1704: 1701: 1698: 1695: 1692: 1688: 1685: 1682: 1679: 1676: 1673: 1670: 1667: 1664: 1661: 1658: 1655: 1652: 1649: 1646: 1643: 1640: 1637: 1634: 1631: 1625: 1624: 1621: 1618: 1615: 1612: 1609: 1606: 1603: 1600: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1537: 1534: 1531: 1528: 1525: 1522: 1519: 1516: 1513: 1510: 1507: 1504: 1501: 1498: 1495: 1492: 1489: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1441: 1438: 1435: 1432: 1429: 1426: 1423: 1420: 1417: 1407: 1406: 1403: 1400: 1397: 1394: 1391: 1388: 1385: 1382: 1379: 1376: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1340: 1337: 1334: 1331: 1328: 1325: 1322: 1319: 1316: 1313: 1310: 1307: 1304: 1301: 1298: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1268: 1265: 1262: 1259: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1232: 1229: 1226: 1220: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1168: 1165: 1162: 1159: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1086: 1082: 1079: 1078: 1075: 1072: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 991: 988: 985: 968:lambda calculus 964: 963: 960: 957: 954: 951: 948: 945: 942: 939: 936: 933: 930: 927: 924: 921: 918: 915: 912: 909: 906: 903: 900: 897: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 848: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 754: 751: 748: 745: 742: 739: 736: 733: 730: 727: 724: 721: 718: 715: 699: 698: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 614: 611: 608: 605: 602: 599: 596: 590: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 514: 511: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 424: 423: 420: 417: 414: 411: 408: 405: 402: 399: 396: 393: 390: 387: 384: 381: 378: 375: 372: 369: 366: 363: 360: 341: 336: 335: 332: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 293: 290: 287: 284: 281: 278: 275: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 239: 238: 235: 232: 229: 226: 223: 220: 217: 214: 211: 208: 205: 202: 199: 196: 193: 190: 187: 184: 181: 178: 175: 172: 169: 166: 163: 160: 157: 154: 151: 148: 145: 131: 129:Named functions 126: 73:or are used as 63: 51:lambda calculus 17: 12: 11: 5: 2852: 2850: 2842: 2841: 2831: 2830: 2825: 2824: 2805: 2792: 2776: 2760: 2747: 2745: 2744: 2737: 2706: 2684: 2672: 2671: 2669: 2666: 2528: 2423: 2409: 2406: 2399:"\n" 2295: 2280:Starting with 2277: 2274: 2178: 2160: 2157: 2028: 2017:, the current 2010: 2007: 2005: 2002: 1830: 1630: 1416: 1225: 1098: 984: 853: 714: 595: 429: 359: 340: 337: 244: 144: 130: 127: 125: 122: 102:self-reference 62: 59: 15: 13: 10: 9: 6: 4: 3: 2: 2851: 2840: 2837: 2836: 2834: 2822: 2821:StackOverflow 2818: 2814: 2809: 2806: 2802: 2796: 2793: 2789: 2785: 2780: 2777: 2773: 2769: 2764: 2761: 2757: 2754:The If Works 2751: 2748: 2742: 2738: 2735: 2731: 2730:1-59059-873-3 2727: 2723: 2719: 2718: 2716: 2710: 2707: 2704: 2703:StackOverflow 2700: 2696: 2691: 2689: 2685: 2682: 2677: 2674: 2667: 2526: 2421: 2415: 2407: 2293: 2283: 2275: 2176: 2166: 2158: 2026: 2020: 2016: 2008: 2003: 1828: 1628: 1414: 1412: 1223: 1096: 1094: 1093: 982: 980: 976: 974: 969: 851: 712: 711: 709: 704: 593: 427: 357: 354: 351: 347: 338: 242: 142: 139: 137: 128: 123: 121: 119: 113: 111: 108:" keyword in 107: 103: 99: 95: 91: 87: 82: 80: 79:bind the name 76: 72: 68: 60: 58: 56: 52: 47: 45: 40: 38: 34: 30: 26: 22: 2820: 2808: 2795: 2784:Nux's answer 2779: 2763: 2750: 2721: 2709: 2702: 2676: 2581:sys.function 2516: 2411: 2279: 2162: 2012: 1826: 1626: 1411:Y combinator 1408: 1221: 1090: 1087:fact1(fact1) 1080: 973:Y combinator 971: 965: 849: 706: 700: 591: 425: 355: 345: 342: 240: 140: 132: 124:Alternatives 114: 88:. Anonymous 83: 64: 48: 41: 24: 18: 2720:Trey Nash, 2799:Perldoc, " 2668:References 2165:JavaScript 2159:JavaScript 1092:combinator 708:combinator 94:call stack 44:JavaScript 37:reflection 2839:Recursion 2739:Wes Dyer 2237:arguments 705:called a 306:factorial 258:factorial 203:arguments 75:callbacks 29:recursion 2833:Category 2734:Wes Dyer 2715:folklore 2533:function 2443:function 2189:function 2004:Examples 1095:yields: 979:currying 255:function 155:function 71:closures 2554:is.list 2354:__SUB__ 2303:feature 2286:__SUB__ 966:In the 2728:  2695:answer 2569:lapply 2519:lapply 2494:Recall 2476:return 2425:sapply 2418:Recall 2243:callee 2204:return 2153:362880 1950:lambda 1938:lambda 1907:lambda 1892:lambda 1862:lambda 1847:lambda 1835:lambda 1756:lambda 1744:lambda 1711:lambda 1696:lambda 1665:lambda 1650:lambda 1638:lambda 1556:lambda 1544:lambda 1511:lambda 1478:lambda 1463:lambda 1451:lambda 1424:lambda 1332:lambda 1320:lambda 1287:lambda 1272:lambda 1260:lambda 1233:lambda 1145:lambda 1133:lambda 1106:lambda 1004:lambda 992:lambda 901:lambda 870:lambda 858:lambda 767:lambda 734:lambda 722:lambda 672:lambda 603:lambda 563:lambda 500:lambda 467:return 461:return 397:return 391:return 346:itself 273:return 209:callee 170:return 100:. The 2387:-> 2357:-> 2330:shift 2312:print 2290:undef 2150:40320 1819:fact1 1738:fact1 1619:fact1 1538:fact1 1401:fact1 1314:fact1 1214:fact1 1127:fact1 1073:fact1 1067:fact1 986:fact1 842:fact1 761:fact1 687:fact1 681:fact1 597:fact1 578:fact0 572:fact1 494:fact1 476:fact0 434:fact0 2786:to " 2770:to " 2726:ISBN 2647:list 2623:list 2617:list 2596:else 2339:> 2282:Perl 2276:Perl 2219:> 2147:5040 1974:else 1931:)))) 1807:fact 1780:else 1607:fact 1580:else 1383:fact 1356:else 1202:fact 1169:else 1083:f(f) 1061:fact 1028:else 931:else 830:fact 797:else 666:fact 633:else 557:fact 530:else 406:fact 364:fact 288:> 185:> 106:this 2819:at 2815:to 2701:", 2662:))) 2614:})( 2548:if 2458:if 2412:In 2363:$ x 2348:$ x 2336:$ x 2324:$ x 2315:sub 2300:use 2270:}); 2183:map 2163:In 2144:720 2141:120 2072:120 2019:dfn 2015:APL 2013:In 2009:APL 1998:))) 1886:))) 1735:))) 1689:))) 1502:))) 1311:))) 894:))) 431:def 361:def 333:}); 249:map 236:}); 149:map 61:Use 27:is 19:In 2835:: 2687:^ 2644:), 2590:)) 2563:)) 2512:}) 2467:== 2396:), 2321:my 2225:)) 2138:24 2120:10 2084:โต: 2039:โต: 1989:n1 1977:n1 1968:== 1965:n1 1962:if 1953:n1 1933:\ 1925:)( 1880:)( 1804:)) 1795:n1 1783:n1 1774:== 1771:n1 1768:if 1759:n1 1729:)( 1683:)( 1604:)) 1595:n1 1583:n1 1574:== 1571:n1 1568:if 1559:n1 1535:)) 1496:)( 1413:: 1404:)) 1380:)) 1371:n1 1359:n1 1350:== 1347:n1 1344:if 1335:n1 1305:)( 1199:)) 1190:n1 1187:)( 1172:n1 1163:== 1160:n1 1157:if 1148:n1 1058:)) 1049:n1 1046:)( 1031:n1 1022:== 1019:n1 1016:if 1007:n1 981:: 961:)) 952:n1 934:n1 925:== 922:n1 919:if 910:n1 896:\ 818:n1 800:n1 791:== 788:n1 785:if 776:n1 758:)) 654:n1 636:n1 627:== 624:n1 621:if 612:n1 545:n1 533:n1 524:== 521:n1 518:if 509:n1 482:n0 470:n0 452:== 449:n0 446:if 443:): 440:n0 382:== 376:if 373:): 294:)) 191:)) 138:. 136:Go 57:. 23:, 2790:" 2774:" 2659:5 2656:, 2653:4 2650:( 2641:3 2638:, 2635:2 2632:, 2629:1 2626:( 2620:( 2611:} 2608:2 2605:^ 2602:x 2599:{ 2593:} 2587:0 2584:( 2578:, 2575:x 2572:( 2566:{ 2560:x 2557:( 2551:( 2545:{ 2542:) 2539:x 2536:( 2530:( 2509:) 2506:1 2503:- 2500:n 2497:( 2491:* 2488:n 2485:) 2482:1 2479:( 2473:) 2470:0 2464:n 2461:( 2455:{ 2452:) 2449:n 2446:( 2440:, 2437:5 2434:: 2431:0 2428:( 2414:R 2408:R 2402:; 2393:5 2390:( 2384:} 2381:; 2378:1 2375:: 2372:) 2369:1 2366:- 2360:( 2351:* 2345:? 2342:0 2333:; 2327:= 2318:{ 2309:; 2267:; 2264:n 2261:* 2258:) 2255:1 2252:- 2249:n 2246:( 2240:. 2234:: 2231:1 2228:? 2222:1 2216:n 2213:( 2210:! 2207:( 2201:{ 2198:) 2195:n 2192:( 2186:( 2180:. 2135:6 2132:2 2129:1 2126:1 2117:โณ 2114:ยจ 2111:} 2108:1 2105:- 2102:โต 2099:โˆ‡ 2096:ร— 2093:โต 2090:โ‹„ 2087:1 2081:= 2078:0 2075:{ 2069:5 2066:} 2063:1 2060:- 2057:โต 2054:โˆ‡ 2051:ร— 2048:โต 2045:โ‹„ 2042:1 2036:= 2033:0 2030:{ 2023:โˆ‡ 1995:1 1992:- 1986:( 1983:g 1980:* 1971:0 1959:1 1956:: 1947:( 1944:: 1941:g 1935:( 1928:v 1922:x 1919:( 1916:x 1913:: 1910:v 1904:( 1901:f 1898:: 1895:x 1889:( 1883:v 1877:x 1874:( 1871:x 1868:: 1865:v 1859:( 1856:f 1853:: 1850:x 1844:( 1841:: 1838:f 1832:( 1822:) 1816:( 1813:Y 1810:= 1801:1 1798:- 1792:( 1789:g 1786:* 1777:0 1765:1 1762:: 1753:( 1750:: 1747:g 1741:= 1732:v 1726:x 1723:( 1720:x 1717:: 1714:v 1708:( 1705:f 1702:: 1699:x 1693:( 1686:v 1680:x 1677:( 1674:x 1671:: 1668:v 1662:( 1659:f 1656:: 1653:x 1647:( 1644:: 1641:f 1635:= 1632:Y 1622:) 1616:( 1613:Y 1610:= 1601:1 1598:- 1592:( 1589:g 1586:* 1577:0 1565:1 1562:: 1553:( 1550:: 1547:g 1541:= 1532:y 1529:( 1526:D 1523:( 1520:C 1517:: 1514:y 1508:= 1505:Y 1499:v 1493:x 1490:( 1487:x 1484:: 1481:v 1475:( 1472:f 1469:: 1466:x 1460:( 1457:: 1454:f 1448:= 1445:D 1442:) 1439:x 1436:( 1433:x 1430:: 1427:x 1421:= 1418:C 1398:( 1395:D 1392:( 1389:C 1386:= 1377:1 1374:- 1368:( 1365:g 1362:* 1353:0 1341:1 1338:: 1329:( 1326:: 1323:g 1317:= 1308:v 1302:x 1299:( 1296:x 1293:: 1290:v 1284:( 1281:f 1278:: 1275:x 1269:( 1266:: 1263:f 1257:= 1254:D 1251:) 1248:x 1245:( 1242:x 1239:: 1236:x 1230:= 1227:C 1217:) 1211:( 1208:C 1205:= 1196:1 1193:- 1184:f 1181:( 1178:f 1175:* 1166:0 1154:1 1151:: 1142:( 1139:: 1136:f 1130:= 1124:) 1121:x 1118:( 1115:x 1112:: 1109:x 1103:= 1100:C 1076:) 1070:( 1064:= 1055:1 1052:- 1043:f 1040:( 1037:f 1034:* 1025:0 1013:1 1010:: 1001:( 998:: 995:f 989:= 975:. 958:1 955:- 949:, 946:g 943:( 940:g 937:* 928:0 916:1 913:: 907:, 904:g 898:( 891:x 888:, 885:f 882:( 879:f 876:: 873:x 867:( 864:: 861:f 855:( 845:) 839:( 836:F 833:= 827:) 824:1 821:- 815:, 812:f 809:( 806:f 803:* 794:0 782:1 779:: 773:, 770:f 764:= 755:x 752:, 749:f 746:( 743:f 740:: 737:x 731:( 728:: 725:f 719:= 716:F 710:: 696:) 693:n 690:, 684:( 678:: 675:n 669:= 663:) 660:1 657:- 651:, 648:f 645:( 642:f 639:* 630:0 618:1 615:: 609:, 606:f 600:= 587:) 584:n 581:, 575:( 569:: 566:n 560:= 554:) 551:1 548:- 542:( 539:f 536:* 527:0 515:1 512:: 506:, 503:f 497:= 491:) 488:1 485:- 479:( 473:* 464:1 458:: 455:0 437:( 421:) 418:1 415:- 412:n 409:( 403:* 400:n 394:1 388:: 385:0 379:n 370:n 367:( 330:; 327:n 324:* 321:) 318:1 315:- 312:n 309:( 303:: 300:1 297:? 291:1 285:n 282:( 279:! 276:( 270:{ 267:) 264:n 261:( 252:( 246:. 233:; 230:n 227:* 224:) 221:1 218:- 215:n 212:( 206:. 200:: 197:1 194:? 188:1 182:n 179:( 176:! 173:( 167:{ 164:) 161:n 158:( 152:( 146:.

Index

computer science
recursion
higher-order function
reflection
JavaScript
lambda calculus
fixed-point combinators
anonymous functions
closures
callbacks
bind the name
direct recursion
indirect recursion
call stack
mutual recursion
self-reference
this
object-oriented programming
programming style
Go
fixed-point combinator
higher-order function
combinator
lambda calculus
Y combinator
currying
combinator
Y combinator
APL
dfn

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

โ†‘