/usr/share/doc/yacas-doc/html/refchapter21.html is in yacas-doc 1.3.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 | <html>
<head>
<title>List operations</title>
<link rel="stylesheet" href="yacas.css" TYPE="text/css" MEDIA="screen">
</head>
<body>
<a name="c21">
</a>
(directly go to documentation on : <a href="refchapter21.html#Head" target='Chapters' title="the first element of a list">Head</a>, <a href="refchapter21.html#Tail" target='Chapters' title="returns a list without its first element">Tail</a>, <a href="refchapter21.html#Length" target='Chapters' title="the length of a list or string">Length</a>, <a href="refchapter21.html#Map" target='Chapters' title="apply an <b>n</b>-ary function to all entries in a list">Map</a>, <a href="refchapter21.html#MapSingle" target='Chapters' title="apply a unary function to all entries in a list">MapSingle</a>, <a href="refchapter21.html#MakeVector" target='Chapters' title="vector of uniquely numbered variable names">MakeVector</a>, <a href="refchapter21.html#Select" target='Chapters' title="select entries satisfying some predicate">Select</a>, <a href="refchapter21.html#Nth" target='Chapters' title="return the <b> n</b>-th element of a list">Nth</a>, <a href="refchapter21.html#DestructiveReverse" target='Chapters' title="reverse a list destructively">DestructiveReverse</a>, <a href="refchapter21.html#Reverse" target='Chapters' title="return the reversed list (without touching the original)">Reverse</a>, <a href="refchapter21.html#List" target='Chapters' title="construct a list">List</a>, <a href="refchapter21.html#UnList" target='Chapters' title="convert a list to a function application">UnList</a>, <a href="refchapter21.html#Listify" target='Chapters' title="convert a function application to a list">Listify</a>, <a href="refchapter21.html#Concat" target='Chapters' title="concatenate lists">Concat</a>, <a href="refchapter21.html#Delete" target='Chapters' title="delete an element from a list">Delete</a>, <a href="refchapter21.html#Insert" target='Chapters' title="insert an element into a list">Insert</a>, <a href="refchapter21.html#DestructiveDelete" target='Chapters' title="delete an element destructively from a list">DestructiveDelete</a>, <a href="refchapter21.html#DestructiveInsert" target='Chapters' title="insert an element destructively into a list">DestructiveInsert</a>, <a href="refchapter21.html#Replace" target='Chapters' title="replace an entry in a list">Replace</a>, <a href="refchapter21.html#DestructiveReplace" target='Chapters' title="replace an entry destructively in a list">DestructiveReplace</a>, <a href="refchapter21.html#FlatCopy" target='Chapters' title="copy the top level of a list">FlatCopy</a>, <a href="refchapter21.html#Contains" target='Chapters' title="test whether a list contains a certain element">Contains</a>, <a href="refchapter21.html#Find" target='Chapters' title="get the index at which a certain element occurs">Find</a>, <a href="refchapter21.html#Append" target='Chapters' title="append an entry at the end of a list">Append</a>, <a href="refchapter21.html#DestructiveAppend" target='Chapters' title="destructively append an entry to a list">DestructiveAppend</a>, <a href="refchapter21.html#RemoveDuplicates" target='Chapters' title="remove any duplicates from a list">RemoveDuplicates</a>, <a href="refchapter21.html#Push" target='Chapters' title="add an element on top of a stack">Push</a>, <a href="refchapter21.html#Pop" target='Chapters' title="remove an element from a stack">Pop</a>, <a href="refchapter21.html#PopFront" target='Chapters' title="remove an element from the top of a stack">PopFront</a>, <a href="refchapter21.html#PopBack" target='Chapters' title="remove an element from the bottom of a stack">PopBack</a>, <a href="refchapter21.html#Swap" target='Chapters' title="swap two elements in a list">Swap</a>, <a href="refchapter21.html#Count" target='Chapters' title="count the number of occurrences of an expression">Count</a>, <a href="refchapter21.html#Intersection" target='Chapters' title="return the intersection of two lists">Intersection</a>, <a href="refchapter21.html#Union" target='Chapters' title="return the union of two lists">Union</a>, <a href="refchapter21.html#Difference" target='Chapters' title="return the difference of two lists">Difference</a>, <a href="refchapter21.html#FillList" target='Chapters' title="fill a list with a certain expression">FillList</a>, <a href="refchapter21.html#Drop" target='Chapters' title="drop a range of elements from a list">Drop</a>, <a href="refchapter21.html#Take" target='Chapters' title="take a sublist from a list, dropping the rest">Take</a>, <a href="refchapter21.html#Partition" target='Chapters' title="partition a list in sublists of equal length">Partition</a>, <a href="refchapter21.html#Assoc" target='Chapters' title="return element stored in association list">Assoc</a>, <a href="refchapter21.html#AssocIndices" target='Chapters' title="return the keys in an association list">AssocIndices</a>, <a href="refchapter21.html#AssocDelete" target='Chapters' title="delete an entry in an association list">AssocDelete</a>, <a href="refchapter21.html#Flatten" target='Chapters' title="flatten expression w.r.t. some operator">Flatten</a>, <a href="refchapter21.html#UnFlatten" target='Chapters' title="inverse operation of Flatten">UnFlatten</a>, <a href="refchapter21.html#Type" target='Chapters' title="return the type of an expression">Type</a>, <a href="refchapter21.html#NrArgs" target='Chapters' title="return number of top-level arguments">NrArgs</a>, <a href="refchapter21.html#VarList" target='Chapters' title="list of variables appearing in an expression">VarList</a>, <a href="refchapter21.html#VarListArith" target='Chapters' title="list of variables appearing in an expression">VarListArith</a>, <a href="refchapter21.html#VarListSome" target='Chapters' title="list of variables appearing in an expression">VarListSome</a>, <a href="refchapter21.html#FuncList" target='Chapters' title="list of functions used in an expression">FuncList</a>, <a href="refchapter21.html#FuncListArith" target='Chapters' title="list of functions used in an expression">FuncListArith</a>, <a href="refchapter21.html#FuncListSome" target='Chapters' title="list of functions used in an expression">FuncListSome</a>, <a href="refchapter21.html#BubbleSort" target='Chapters' title="sort a list">BubbleSort</a>, <a href="refchapter21.html#HeapSort" target='Chapters' title="sort a list">HeapSort</a>, <a href="refchapter21.html#PrintList" target='Chapters' title="print list with padding">PrintList</a>, <a href="refchapter21.html#Table" target='Chapters' title="evaluate while some variable ranges over interval">Table</a>, <a href="refchapter21.html#TableForm" target='Chapters' title="print each entry in a list on a line">TableForm</a>, <a href="refchapter21.html#GlobalPop" target='Chapters' title="restore variables using a global stack">GlobalPop</a>, <a href="refchapter21.html#GlobalPush" target='Chapters' title="save variables using a global stack">GlobalPush</a>.
)<h1>
21. List operations
</h1>
Most objects that can be of variable size are represented as lists
(linked lists internally). Yacas does implement arrays, which are
faster when the number of elements in a collection of objects doesn't
change. Operations on lists have better support in the current
system.
<p> </p>
<center><table>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Head" target='Chapters' title="the first element of a list">Head</a></td>
<td>the first element of a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Tail" target='Chapters' title="returns a list without its first element">Tail</a></td>
<td>returns a list without its first element</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Length" target='Chapters' title="the length of a list or string">Length</a></td>
<td>the length of a list or string</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Map" target='Chapters' title="apply an <b>n</b>-ary function to all entries in a list">Map</a></td>
<td>apply an <b>n</b>-ary function to all entries in a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#MapSingle" target='Chapters' title="apply a unary function to all entries in a list">MapSingle</a></td>
<td>apply a unary function to all entries in a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#MakeVector" target='Chapters' title="vector of uniquely numbered variable names">MakeVector</a></td>
<td>vector of uniquely numbered variable names</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Select" target='Chapters' title="select entries satisfying some predicate">Select</a></td>
<td>select entries satisfying some predicate</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Nth" target='Chapters' title="return the <b> n</b>-th element of a list">Nth</a></td>
<td>return the <b> n</b>-th element of a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#DestructiveReverse" target='Chapters' title="reverse a list destructively">DestructiveReverse</a></td>
<td>reverse a list destructively</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Reverse" target='Chapters' title="return the reversed list (without touching the original)">Reverse</a></td>
<td>return the reversed list (without touching the original)</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#List" target='Chapters' title="construct a list">List</a></td>
<td>construct a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#UnList" target='Chapters' title="convert a list to a function application">UnList</a></td>
<td>convert a list to a function application</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Listify" target='Chapters' title="convert a function application to a list">Listify</a></td>
<td>convert a function application to a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Concat" target='Chapters' title="concatenate lists">Concat</a></td>
<td>concatenate lists</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Delete" target='Chapters' title="delete an element from a list">Delete</a></td>
<td>delete an element from a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Insert" target='Chapters' title="insert an element into a list">Insert</a></td>
<td>insert an element into a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#DestructiveDelete" target='Chapters' title="delete an element destructively from a list">DestructiveDelete</a></td>
<td>delete an element destructively from a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#DestructiveInsert" target='Chapters' title="insert an element destructively into a list">DestructiveInsert</a></td>
<td>insert an element destructively into a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Replace" target='Chapters' title="replace an entry in a list">Replace</a></td>
<td>replace an entry in a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#DestructiveReplace" target='Chapters' title="replace an entry destructively in a list">DestructiveReplace</a></td>
<td>replace an entry destructively in a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#FlatCopy" target='Chapters' title="copy the top level of a list">FlatCopy</a></td>
<td>copy the top level of a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Contains" target='Chapters' title="test whether a list contains a certain element">Contains</a></td>
<td>test whether a list contains a certain element</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Find" target='Chapters' title="get the index at which a certain element occurs">Find</a></td>
<td>get the index at which a certain element occurs</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Append" target='Chapters' title="append an entry at the end of a list">Append</a></td>
<td>append an entry at the end of a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#DestructiveAppend" target='Chapters' title="destructively append an entry to a list">DestructiveAppend</a></td>
<td>destructively append an entry to a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#RemoveDuplicates" target='Chapters' title="remove any duplicates from a list">RemoveDuplicates</a></td>
<td>remove any duplicates from a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Push" target='Chapters' title="add an element on top of a stack">Push</a></td>
<td>add an element on top of a stack</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Pop" target='Chapters' title="remove an element from a stack">Pop</a></td>
<td>remove an element from a stack</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#PopFront" target='Chapters' title="remove an element from the top of a stack">PopFront</a></td>
<td>remove an element from the top of a stack</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#PopBack" target='Chapters' title="remove an element from the bottom of a stack">PopBack</a></td>
<td>remove an element from the bottom of a stack</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Swap" target='Chapters' title="swap two elements in a list">Swap</a></td>
<td>swap two elements in a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Count" target='Chapters' title="count the number of occurrences of an expression">Count</a></td>
<td>count the number of occurrences of an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Intersection" target='Chapters' title="return the intersection of two lists">Intersection</a></td>
<td>return the intersection of two lists</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Union" target='Chapters' title="return the union of two lists">Union</a></td>
<td>return the union of two lists</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Difference" target='Chapters' title="return the difference of two lists">Difference</a></td>
<td>return the difference of two lists</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#FillList" target='Chapters' title="fill a list with a certain expression">FillList</a></td>
<td>fill a list with a certain expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Drop" target='Chapters' title="drop a range of elements from a list">Drop</a></td>
<td>drop a range of elements from a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Take" target='Chapters' title="take a sublist from a list, dropping the rest">Take</a></td>
<td>take a sublist from a list, dropping the rest</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Partition" target='Chapters' title="partition a list in sublists of equal length">Partition</a></td>
<td>partition a list in sublists of equal length</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Assoc" target='Chapters' title="return element stored in association list">Assoc</a></td>
<td>return element stored in association list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#AssocIndices" target='Chapters' title="return the keys in an association list">AssocIndices</a></td>
<td>return the keys in an association list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#AssocDelete" target='Chapters' title="delete an entry in an association list">AssocDelete</a></td>
<td>delete an entry in an association list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Flatten" target='Chapters' title="flatten expression w.r.t. some operator">Flatten</a></td>
<td>flatten expression w.r.t. some operator</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#UnFlatten" target='Chapters' title="inverse operation of Flatten">UnFlatten</a></td>
<td>inverse operation of Flatten</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Type" target='Chapters' title="return the type of an expression">Type</a></td>
<td>return the type of an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#NrArgs" target='Chapters' title="return number of top-level arguments">NrArgs</a></td>
<td>return number of top-level arguments</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#VarList" target='Chapters' title="list of variables appearing in an expression">VarList</a></td>
<td>list of variables appearing in an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#VarListArith" target='Chapters' title="list of variables appearing in an expression">VarListArith</a></td>
<td>list of variables appearing in an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#VarListSome" target='Chapters' title="list of variables appearing in an expression">VarListSome</a></td>
<td>list of variables appearing in an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#FuncList" target='Chapters' title="list of functions used in an expression">FuncList</a></td>
<td>list of functions used in an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#FuncListArith" target='Chapters' title="list of functions used in an expression">FuncListArith</a></td>
<td>list of functions used in an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#FuncListSome" target='Chapters' title="list of functions used in an expression">FuncListSome</a></td>
<td>list of functions used in an expression</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#BubbleSort" target='Chapters' title="sort a list">BubbleSort</a></td>
<td>sort a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#HeapSort" target='Chapters' title="sort a list">HeapSort</a></td>
<td>sort a list</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#PrintList" target='Chapters' title="print list with padding">PrintList</a></td>
<td>print list with padding</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#Table" target='Chapters' title="evaluate while some variable ranges over interval">Table</a></td>
<td>evaluate while some variable ranges over interval</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#TableForm" target='Chapters' title="print each entry in a list on a line">TableForm</a></td>
<td>print each entry in a list on a line</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#GlobalPop" target='Chapters' title="restore variables using a global stack">GlobalPop</a></td>
<td>restore variables using a global stack</td>
</tr>
<tr BGCOLOR=#E0E0E0>
<td><a href="refchapter21.html#GlobalPush" target='Chapters' title="save variables using a global stack">GlobalPush</a></td>
<td>save variables using a global stack</td>
</tr>
</table></center>
<p>
<a name="Head">
</a>
<a name="head">
</a>
<h3>
<hr>Head -- the first element of a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Head(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- a list
<p>
<h5>
Description:
</h5>
This function returns the first element of a list. If it is applied to
a general expression, it returns the first operand. An error is
returned if "list" is an atom.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Head({a,b,c})
Out> a;
In> Head(f(a,b,c));
Out> a;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Tail" target="Chapters">
Tail
</a>
, <a href="ref.html?Length" target="Chapters">
Length
</a>
.<a name="Tail">
</a>
<a name="tail">
</a>
<h3>
<hr>Tail -- returns a list without its first element
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Tail(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- a list
<p>
<h5>
Description:
</h5>
This function returns "list" without its first element.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Tail({a,b,c})
Out> {b,c};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Head" target="Chapters">
Head
</a>
, <a href="ref.html?Length" target="Chapters">
Length
</a>
.<a name="Length">
</a>
<a name="length">
</a>
<h3>
<hr>Length -- the length of a list or string
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Length(object)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>object</tt></b> -- a list, array or string
<p>
<h5>
Description:
</h5>
Length returns the length of a list.
This function also works on strings and arrays.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Length({a,b,c})
Out> 3;
In> Length("abcdef");
Out> 6;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Head" target="Chapters">
Head
</a>
, <a href="ref.html?Tail" target="Chapters">
Tail
</a>
, <a href="ref.html?Nth" target="Chapters">
Nth
</a>
, <a href="ref.html?Count" target="Chapters">
Count
</a>
.<a name="Map">
</a>
<a name="map">
</a>
<h3>
<hr>Map -- apply an <b>n</b>-ary function to all entries in a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Map(fn, list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>fn</tt></b> -- function to apply
<p>
<b><tt>list</tt></b> -- list of lists of arguments
<p>
<h5>
Description:
</h5>
This function applies "fn" to every list of arguments to be found in
"list". So the first entry of "list" should be a list containing
the first, second, third, ... argument to "fn", and the same goes
for the other entries of "list". The function can either be given as
a string or as a pure function (see Apply for more information on
pure functions).
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> MapSingle("Sin",{a,b,c});
Out> {Sin(a),Sin(b),Sin(c)};
In> Map("+",{{a,b},{c,d}});
Out> {a+c,b+d};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?MapSingle" target="Chapters">
MapSingle
</a>
, <a href="ref.html?MapArgs" target="Chapters">
MapArgs
</a>
, <a href="ref.html?Apply" target="Chapters">
Apply
</a>
.<a name="MapSingle">
</a>
<a name="mapsingle">
</a>
<h3>
<hr>MapSingle -- apply a unary function to all entries in a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
MapSingle(fn, list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>fn</tt></b> -- function to apply
<p>
<b><tt>list</tt></b> -- list of arguments
<p>
<h5>
Description:
</h5>
The function "fn" is successively applied to all entries in
"list", and a list containing the respective results is
returned. The function can be given either as a string or as a pure
function (see Apply for more information on pure functions).
<p>
The <b><tt>/@</tt></b> operator provides a shorthand for
<b><tt>MapSingle</tt></b>.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> MapSingle("Sin",{a,b,c});
Out> {Sin(a),Sin(b),Sin(c)};
In> MapSingle({{x},x^2}, {a,2,c});
Out> {a^2,4,c^2};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Map" target="Chapters">
Map
</a>
, <a href="ref.html?MapArgs" target="Chapters">
MapArgs
</a>
, <a href="ref.html?/@" target="Chapters">
/@
</a>
, <a href="ref.html?Apply" target="Chapters">
Apply
</a>
.<a name="MakeVector">
</a>
<a name="makevector">
</a>
<h3>
<hr>MakeVector -- vector of uniquely numbered variable names
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
MakeVector(var,n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>var</tt></b> -- free variable
<p>
<b><tt>n</tt></b> -- length of the vector
<p>
<h5>
Description:
</h5>
A list of length "n" is generated. The first entry contains the
identifier "var" with the number 1 appended to it, the second entry
contains "var" with the suffix 2, and so on until the last entry
which contains "var" with the number "n" appended to it.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> MakeVector(a,3)
Out> {a1,a2,a3};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?RandomIntegerVector" target="Chapters">
RandomIntegerVector
</a>
, <a href="ref.html?ZeroVector" target="Chapters">
ZeroVector
</a>
.<a name="Select">
</a>
<a name="select">
</a>
<h3>
<hr>Select -- select entries satisfying some predicate
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Select(pred, list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>pred</tt></b> -- a predicate
<p>
<b><tt>list</tt></b> -- a list of elements to select from
<p>
<h5>
Description:
</h5>
<b><tt>Select</tt></b> returns a sublist of "list" which contains all
the entries for which the predicate "pred" returns
<b><tt>True</tt></b> when applied to this entry.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Select("IsInteger",{a,b,2,c,3,d,4,e,f})
Out> {2,3,4};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Length" target="Chapters">
Length
</a>
, <a href="ref.html?Find" target="Chapters">
Find
</a>
, <a href="ref.html?Count" target="Chapters">
Count
</a>
.<a name="Nth">
</a>
<a name="nth">
</a>
<h3>
<hr>Nth -- return the <b> n</b>-th element of a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Nth(list, n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to choose from
<p>
<b><tt>n</tt></b> -- index of entry to pick
<p>
<h5>
Description:
</h5>
The entry with index "n" from "list" is returned. The first entry
has index 1. It is possible to pick several entries of the list by
taking "n" to be a list of indices.
<p>
More generally, <b><tt>Nth</tt></b> returns the n-th operand of the
expression passed as first argument.
<p>
An alternative but equivalent form of <b><tt>Nth(list, n)</tt></b> is
<b><tt>list[n]</tt></b>.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,13,19};
Out> {a,b,c,13,19};
In> Nth(lst, 3);
Out> c;
In> lst[3];
Out> c;
In> Nth(lst, {3,4,1});
Out> {c,13,a};
In> Nth(b*(a+c), 2);
Out> a+c;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Select" target="Chapters">
Select
</a>
, <a href="ref.html?Nth" target="Chapters">
Nth
</a>
.<a name="DestructiveReverse">
</a>
<a name="destructivereverse">
</a>
<h3>
<hr>DestructiveReverse -- reverse a list destructively
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
DestructiveReverse(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to reverse
<p>
<h5>
Description:
</h5>
This command reverses "list" in place, so that the original is
destroyed. This means that any variable bound to "list" will now have
an undefined content, and should not be used any more.
The reversed list is returned.
<p>
Destructive commands are faster than their nondestructive
counterparts. <b><tt>Reverse</tt></b> is the non-destructive version of
this function.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,13,19};
Out> {a,b,c,13,19};
In> revlst := DestructiveReverse(lst);
Out> {19,13,c,b,a};
In> lst;
Out> {a};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?FlatCopy" target="Chapters">
FlatCopy
</a>
, <a href="ref.html?Reverse" target="Chapters">
Reverse
</a>
.<a name="Reverse">
</a>
<a name="reverse">
</a>
<h3>
<hr>Reverse -- return the reversed list (without touching the original)
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Reverse(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to reverse
<p>
<h5>
Description:
</h5>
This function returns a list reversed, without changing the
original list. It is similar to <b><tt>DestructiveReverse</tt></b>, but safer
and slower.
<p>
<h5>
Example:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst:={a,b,c,13,19}
Out> {a,b,c,13,19};
In> revlst:=Reverse(lst)
Out> {19,13,c,b,a};
In> lst
Out> {a,b,c,13,19};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?FlatCopy" target="Chapters">
FlatCopy
</a>
, <a href="ref.html?DestructiveReverse" target="Chapters">
DestructiveReverse
</a>
.<a name="List">
</a>
<a name="list">
</a>
<h3>
<hr>List -- construct a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
List(expr1, expr2, ...)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr1</tt></b>, <b><tt>expr2</tt></b> -- expressions making up the list
<p>
<h5>
Description:
</h5>
A list is constructed whose first entry is "expr1", the second entry
is "expr2", and so on. This command is equivalent to the expression
"<b><tt>expr1, expr2, ...</tt></b>".
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> List();
Out> {};
In> List(a,b);
Out> {a,b};
In> List(a,{1,2},d);
Out> {a,{1,2},d};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?UnList" target="Chapters">
UnList
</a>
, <a href="ref.html?Listify" target="Chapters">
Listify
</a>
.<a name="UnList">
</a>
<a name="unlist">
</a>
<h3>
<hr>UnList -- convert a list to a function application
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
UnList(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to be converted
<p>
<h5>
Description:
</h5>
This command converts a list to a function application. The first
entry of "list" is treated as a function atom, and the following entries
are the arguments to this function. So the function referred to in the
first element of "list" is applied to the other elements.
<p>
Note that "list" is evaluated before the function application is
formed, but the resulting expression is left unevaluated. The functions <b><tt>UnList()</tt></b> and <b><tt>Hold()</tt></b> both stop the process of evaluation.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> UnList({Cos, x});
Out> Cos(x);
In> UnList({f});
Out> f();
In> UnList({Taylor,x,0,5,Cos(x)});
Out> Taylor(x,0,5)Cos(x);
In> Eval(%);
Out> 1-x^2/2+x^4/24;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?List" target="Chapters">
List
</a>
, <a href="ref.html?Listify" target="Chapters">
Listify
</a>
, <a href="ref.html?Hold" target="Chapters">
Hold
</a>
.<a name="Listify">
</a>
<a name="listify">
</a>
<h3>
<hr>Listify -- convert a function application to a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Listify(expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr</tt></b> -- expression to be converted
<p>
<h5>
Description:
</h5>
The parameter "expr" is expected to be a compound object, i.e. not
an atom. It is evaluated and then converted to a list. The first entry
in the list is the top-level operator in the evaluated expression and
the other entries are the arguments to this operator. Finally, the
list is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Listify(Cos(x));
Out> {Cos,x};
In> Listify(3*a);
Out> {*,3,a};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?List" target="Chapters">
List
</a>
, <a href="ref.html?UnList" target="Chapters">
UnList
</a>
, <a href="ref.html?IsAtom" target="Chapters">
IsAtom
</a>
.<a name="Concat">
</a>
<a name="concat">
</a>
<h3>
<hr>Concat -- concatenate lists
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Concat(list1, list2, ...)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list1</tt></b>, <b><tt>list2</tt></b>, ... -- lists to concatenate
<p>
<h5>
Description:
</h5>
The lists "list1", "list2", ... are evaluated and
concatenated. The resulting big list is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Concat({a,b}, {c,d});
Out> {a,b,c,d};
In> Concat({5}, {a,b,c}, {{f(x)}});
Out> {5,a,b,c,{f(x)}};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?ConcatStrings" target="Chapters">
ConcatStrings
</a>
, <a href="ref.html?:" target="Chapters">
:
</a>
, <a href="ref.html?Insert" target="Chapters">
Insert
</a>
.<a name="Delete">
</a>
<a name="delete">
</a>
<h3>
<hr>Delete -- delete an element from a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Delete(list, n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list from which an element should be removed
<p>
<b><tt>n</tt></b> -- index of the element to remove
<p>
<h5>
Description:
</h5>
This command deletes the n-th element from "list". The first
parameter should be a list, while "n" should be a positive integer
less than or equal to the length of "list". The entry with index
"n" is removed (the first entry has index 1), and the resulting list
is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Delete({a,b,c,d,e,f}, 4);
Out> {a,b,c,e,f};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?DestructiveDelete" target="Chapters">
DestructiveDelete
</a>
, <a href="ref.html?Insert" target="Chapters">
Insert
</a>
, <a href="ref.html?Replace" target="Chapters">
Replace
</a>
.<a name="Insert">
</a>
<a name="insert">
</a>
<h3>
<hr>Insert -- insert an element into a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Insert(list, n, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list in which "expr" should be inserted
<p>
<b><tt>n</tt></b> -- index at which to insert
<p>
<b><tt>expr</tt></b> -- expression to insert in "list"
<p>
<h5>
Description:
</h5>
The expression "expr" is inserted just before the n-th entry in
"list". The first parameter "list" should be a list, while "n"
should be a positive integer less than or equal to the length of
"list" plus one. The expression "expr" is placed between the
entries in "list" with entries "n-1" and "n". There are two
border line cases: if "n" is 1, the expression "expr" is placed in
front of the list (just as by the <b><tt>:</tt></b> operator); if "n"
equals the length of "list" plus one, the expression "expr" is
placed at the end of the list (just as by <b><tt>Append</tt></b>). In any
case, the resulting list is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Insert({a,b,c,d}, 4, x);
Out> {a,b,c,x,d};
In> Insert({a,b,c,d}, 5, x);
Out> {a,b,c,d,x};
In> Insert({a,b,c,d}, 1, x);
Out> {x,a,b,c,d};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?DestructiveInsert" target="Chapters">
DestructiveInsert
</a>
, <a href="ref.html?:" target="Chapters">
:
</a>
, <a href="ref.html?Append" target="Chapters">
Append
</a>
, <a href="ref.html?Delete" target="Chapters">
Delete
</a>
, <a href="ref.html?Remove" target="Chapters">
Remove
</a>
.<a name="DestructiveDelete">
</a>
<a name="destructivedelete">
</a>
<h3>
<hr>DestructiveDelete -- delete an element destructively from a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
DestructiveDelete(list, n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list from which an element should be removed
<p>
<b><tt>n</tt></b> -- index of the element to remove
<p>
<h5>
Description:
</h5>
This is the destructive counterpart of <b><tt>Delete</tt></b>. This
command yields the same result as the corresponding call to
<b><tt>Delete</tt></b>, but the original list is modified. So if a
variable is bound to "list", it will now be bound to the list with
the n-th entry removed.
<p>
Destructive commands run faster than their nondestructive counterparts
because the latter copy the list before they alter it.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d,e,f};
Out> {a,b,c,d,e,f};
In> Delete(lst, 4);
Out> {a,b,c,e,f};
In> lst;
Out> {a,b,c,d,e,f};
In> DestructiveDelete(lst, 4);
Out> {a,b,c,e,f};
In> lst;
Out> {a,b,c,e,f};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Delete" target="Chapters">
Delete
</a>
, <a href="ref.html?DestructiveInsert" target="Chapters">
DestructiveInsert
</a>
, <a href="ref.html?DestructiveReplace" target="Chapters">
DestructiveReplace
</a>
.<a name="DestructiveInsert">
</a>
<a name="destructiveinsert">
</a>
<h3>
<hr>DestructiveInsert -- insert an element destructively into a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
DestructiveInsert(list, n, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list in which "expr" should be inserted
<p>
<b><tt>n</tt></b> -- index at which to insert
<p>
<b><tt>expr</tt></b> -- expression to insert in "list"
<p>
<h5>
Description:
</h5>
This is the destructive counterpart of <b><tt>Insert</tt></b>. This
command yields the same result as the corresponding call to
<b><tt>Insert</tt></b>, but the original list is modified. So if a
variable is bound to "list", it will now be bound to the list with
the expression "expr" inserted.
<p>
Destructive commands run faster than their nondestructive counterparts
because the latter copy the list before they alter it.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d};
Out> {a,b,c,d};
In> Insert(lst, 2, x);
Out> {a,x,b,c,d};
In> lst;
Out> {a,b,c,d};
In> DestructiveInsert(lst, 2, x);
Out> {a,x,b,c,d};
In> lst;
Out> {a,x,b,c,d};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Insert" target="Chapters">
Insert
</a>
, <a href="ref.html?DestructiveDelete" target="Chapters">
DestructiveDelete
</a>
, <a href="ref.html?DestructiveReplace" target="Chapters">
DestructiveReplace
</a>
.<a name="Replace">
</a>
<a name="replace">
</a>
<h3>
<hr>Replace -- replace an entry in a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Replace(list, n, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list of which an entry should be replaced
<p>
<b><tt>n</tt></b> -- index of entry to replace
<p>
<b><tt>expr</tt></b> -- expression to replace the n-th entry with
<p>
<h5>
Description:
</h5>
The n-th entry of "list" is replaced by the expression
"expr". This is equivalent to calling <b><tt>Delete</tt></b> and
<b><tt>Insert</tt></b> in sequence. To be precise, the expression
<b><tt>Replace(list, n, expr)</tt></b> has the same result as the
expression <b><tt>Insert(Delete(list, n), n, expr)</tt></b>.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Replace({a,b,c,d,e,f}, 4, x);
Out> {a,b,c,x,e,f};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Delete" target="Chapters">
Delete
</a>
, <a href="ref.html?Insert" target="Chapters">
Insert
</a>
, <a href="ref.html?DestructiveReplace" target="Chapters">
DestructiveReplace
</a>
.<a name="DestructiveReplace">
</a>
<a name="destructivereplace">
</a>
<h3>
<hr>DestructiveReplace -- replace an entry destructively in a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
DestructiveReplace(list, n, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list of which an entry should be replaced
<p>
<b><tt>n</tt></b> -- index of entry to replace
<p>
<b><tt>expr</tt></b> -- expression to replace the n-th entry with
<p>
<h5>
Description:
</h5>
This is the destructive counterpart of <b><tt>Replace</tt></b>. This
command yields the same result as the corresponding call to
<b><tt>Replace</tt></b>, but the original list is modified. So if a
variable is bound to "list", it will now be bound to the list with
the expression "expr" inserted.
<p>
Destructive commands run faster than their nondestructive counterparts
because the latter copy the list before they alter it.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d,e,f};
Out> {a,b,c,d,e,f};
In> Replace(lst, 4, x);
Out> {a,b,c,x,e,f};
In> lst;
Out> {a,b,c,d,e,f};
In> DestructiveReplace(lst, 4, x);
Out> {a,b,c,x,e,f};
In> lst;
Out> {a,b,c,x,e,f};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Replace" target="Chapters">
Replace
</a>
, <a href="ref.html?DestructiveDelete" target="Chapters">
DestructiveDelete
</a>
, <a href="ref.html?DestructiveInsert" target="Chapters">
DestructiveInsert
</a>
.<a name="FlatCopy">
</a>
<a name="flatcopy">
</a>
<h3>
<hr>FlatCopy -- copy the top level of a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
FlatCopy(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to be copied
<p>
<h5>
Description:
</h5>
A copy of "list" is made and returned. The list is not recursed
into, only the first level is copied. This is useful in combination
with the destructive commands that actually modify lists in place (for
efficiency).
<p>
<h5>
Examples:
</h5>
The following shows a possible way to define a command that reverses a
list nondestructively.
<p>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> reverse(l_IsList) <-- DestructiveReverse \
(FlatCopy(l));
Out> True;
In> lst := {a,b,c,d,e};
Out> {a,b,c,d,e};
In> reverse(lst);
Out> {e,d,c,b,a};
In> lst;
Out> {a,b,c,d,e};
</pre></tr>
</table>
<p>
<a name="Contains">
</a>
<a name="contains">
</a>
<h3>
<hr>Contains -- test whether a list contains a certain element
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Contains(list, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to examine
<p>
<b><tt>expr</tt></b> -- expression to look for in "list"
<p>
<h5>
Description:
</h5>
This command tests whether "list" contains the expression "expr"
as an entry. It returns <b><tt>True</tt></b> if it does and
<b><tt>False</tt></b> otherwise. Only the top level of "list" is
examined. The parameter "list" may also be a general expression, in
that case the top-level operands are tested for the occurrence of
"expr".
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Contains({a,b,c,d}, b);
Out> True;
In> Contains({a,b,c,d}, x);
Out> False;
In> Contains({a,{1,2,3},z}, 1);
Out> False;
In> Contains(a*b, b);
Out> True;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Find" target="Chapters">
Find
</a>
, <a href="ref.html?Count" target="Chapters">
Count
</a>
.<a name="Find">
</a>
<a name="find">
</a>
<h3>
<hr>Find -- get the index at which a certain element occurs
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Find(list, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- the list to examine
<p>
<b><tt>expr</tt></b> -- expression to look for in "list"
<p>
<h5>
Description:
</h5>
This commands returns the index at which the expression "expr"
occurs in "list". If "expr" occurs more than once, the lowest
index is returned. If "expr" does not occur at all,
<b><tt>-1</tt></b> is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Find({a,b,c,d,e,f}, d);
Out> 4;
In> Find({1,2,3,2,1}, 2);
Out> 2;
In> Find({1,2,3,2,1}, 4);
Out> -1;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Contains" target="Chapters">
Contains
</a>
.<a name="Append">
</a>
<a name="append">
</a>
<h3>
<hr>Append -- append an entry at the end of a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Append(list, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to append "expr" to
<p>
<b><tt>expr</tt></b> -- expression to append to the list
<p>
<h5>
Description:
</h5>
The expression "expr" is appended at the end of "list" and the
resulting list is returned.
<p>
Note that due to the underlying data structure, the time it takes to
append an entry at the end of a list grows linearly with the length of
the list, while the time for prepending an entry at the beginning is
constant.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Append({a,b,c,d}, 1);
Out> {a,b,c,d,1};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Concat" target="Chapters">
Concat
</a>
, <a href="ref.html?:" target="Chapters">
:
</a>
, <a href="ref.html?DestructiveAppend" target="Chapters">
DestructiveAppend
</a>
.<a name="DestructiveAppend">
</a>
<a name="destructiveappend">
</a>
<h3>
<hr>DestructiveAppend -- destructively append an entry to a list
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
DestructiveAppend(list, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to append "expr" to
<p>
<b><tt>expr</tt></b> -- expression to append to the list
<p>
<h5>
Description:
</h5>
This is the destructive counterpart of <b><tt>Append</tt></b>. This
command yields the same result as the corresponding call to
<b><tt>Append</tt></b>, but the original list is modified. So if a
variable is bound to "list", it will now be bound to the list with
the expression "expr" inserted.
<p>
Destructive commands run faster than their nondestructive counterparts
because the latter copy the list before they alter it.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d};
Out> {a,b,c,d};
In> Append(lst, 1);
Out> {a,b,c,d,1};
In> lst
Out> {a,b,c,d};
In> DestructiveAppend(lst, 1);
Out> {a,b,c,d,1};
In> lst;
Out> {a,b,c,d,1};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Concat" target="Chapters">
Concat
</a>
, <a href="ref.html?:" target="Chapters">
:
</a>
, <a href="ref.html?Append" target="Chapters">
Append
</a>
.<a name="RemoveDuplicates">
</a>
<a name="removeduplicates">
</a>
<h3>
<hr>RemoveDuplicates -- remove any duplicates from a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
RemoveDuplicates(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to act on
<p>
<h5>
Description:
</h5>
This command removes all duplicate elements from a given list and returns the resulting list.
To be
precise, the second occurrence of any entry is deleted, as are the
third, the fourth, etc.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> RemoveDuplicates({1,2,3,2,1});
Out> {1,2,3};
In> RemoveDuplicates({a,1,b,1,c,1});
Out> {a,1,b,c};
</pre></tr>
</table>
<p>
<a name="Push">
</a>
<a name="push">
</a>
<h3>
<hr>Push -- add an element on top of a stack
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Push(stack, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>stack</tt></b> -- a list (which serves as the stack container)
<p>
<b><tt>expr</tt></b> -- expression to push on "stack"
<p>
<h5>
Description:
</h5>
This is part of a simple implementation of a stack, internally
represented as a list. This command pushes the expression "expr" on
top of the stack, and returns the stack afterwards.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> stack := {};
Out> {};
In> Push(stack, x);
Out> {x};
In> Push(stack, x2);
Out> {x2,x};
In> PopFront(stack);
Out> x2;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Pop" target="Chapters">
Pop
</a>
, <a href="ref.html?PopFront" target="Chapters">
PopFront
</a>
, <a href="ref.html?PopBack" target="Chapters">
PopBack
</a>
.<a name="Pop">
</a>
<a name="pop">
</a>
<h3>
<hr>Pop -- remove an element from a stack
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Pop(stack, n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>stack</tt></b> -- a list (which serves as the stack container)
<p>
<b><tt>n</tt></b> -- index of the element to remove
<p>
<h5>
Description:
</h5>
This is part of a simple implementation of a stack, internally
represented as a list. This command removes the element with index
"n" from the stack and returns this element. The top of the stack is
represented by the index 1. Invalid indices, for example indices
greater than the number of element on the stack, lead to an error.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> stack := {};
Out> {};
In> Push(stack, x);
Out> {x};
In> Push(stack, x2);
Out> {x2,x};
In> Push(stack, x3);
Out> {x3,x2,x};
In> Pop(stack, 2);
Out> x2;
In> stack;
Out> {x3,x};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Push" target="Chapters">
Push
</a>
, <a href="ref.html?PopFront" target="Chapters">
PopFront
</a>
, <a href="ref.html?PopBack" target="Chapters">
PopBack
</a>
.<a name="PopFront">
</a>
<a name="popfront">
</a>
<h3>
<hr>PopFront -- remove an element from the top of a stack
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
PopFront(stack)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>stack</tt></b> -- a list (which serves as the stack container)
<p>
<h5>
Description:
</h5>
This is part of a simple implementation of a stack, internally
represented as a list. This command removes the element on the top of
the stack and returns it. This is the last element that is pushed onto
the stack.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> stack := {};
Out> {};
In> Push(stack, x);
Out> {x};
In> Push(stack, x2);
Out> {x2,x};
In> Push(stack, x3);
Out> {x3,x2,x};
In> PopFront(stack);
Out> x3;
In> stack;
Out> {x2,x};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Push" target="Chapters">
Push
</a>
, <a href="ref.html?Pop" target="Chapters">
Pop
</a>
, <a href="ref.html?PopBack" target="Chapters">
PopBack
</a>
.<a name="PopBack">
</a>
<a name="popback">
</a>
<h3>
<hr>PopBack -- remove an element from the bottom of a stack
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
PopBack(stack)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>stack</tt></b> -- a list (which serves as the stack container)
<p>
<h5>
Description:
</h5>
This is part of a simple implementation of a stack, internally
represented as a list. This command removes the element at the bottom
of the stack and returns this element. Of course, the stack should not
be empty.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> stack := {};
Out> {};
In> Push(stack, x);
Out> {x};
In> Push(stack, x2);
Out> {x2,x};
In> Push(stack, x3);
Out> {x3,x2,x};
In> PopBack(stack);
Out> x;
In> stack;
Out> {x3,x2};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Push" target="Chapters">
Push
</a>
, <a href="ref.html?Pop" target="Chapters">
Pop
</a>
, <a href="ref.html?PopFront" target="Chapters">
PopFront
</a>
.<a name="Swap">
</a>
<a name="swap">
</a>
<h3>
<hr>Swap -- swap two elements in a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Swap(list, i1, i2)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- the list in which a pair of entries should be swapped
<p>
<b><tt>i1, i2</tt></b> -- indices of the entries in "list" to swap
<p>
<h5>
Description:
</h5>
This command swaps the pair of entries with entries "i1" and "i2"
in "list". So the element at index "i1" ends up at index "i2"
and the entry at "i2" is put at index "i1". Both indices should be
valid to address elements in the list. Then the updated list is
returned.
<p>
<b><tt>Swap()</tt></b> works also on generic arrays.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d,e,f};
Out> {a,b,c,d,e,f};
In> Swap(lst, 2, 4);
Out> {a,d,c,b,e,f};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Replace" target="Chapters">
Replace
</a>
, <a href="ref.html?DestructiveReplace" target="Chapters">
DestructiveReplace
</a>
, <a href="ref.html?Array'Create" target="Chapters">
Array'Create
</a>
.<a name="Count">
</a>
<a name="count">
</a>
<h3>
<hr>Count -- count the number of occurrences of an expression
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Count(list, expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- the list to examine
<p>
<b><tt>expr</tt></b> -- expression to look for in "list"
<p>
<h5>
Description:
</h5>
This command counts the number of times that the expression "expr"
occurs in "list" and returns this number.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,b,a};
Out> {a,b,c,b,a};
In> Count(lst, a);
Out> 2;
In> Count(lst, c);
Out> 1;
In> Count(lst, x);
Out> 0;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Length" target="Chapters">
Length
</a>
, <a href="ref.html?Select" target="Chapters">
Select
</a>
, <a href="ref.html?Contains" target="Chapters">
Contains
</a>
.<a name="Intersection">
</a>
<a name="intersection">
</a>
<h3>
<hr>Intersection -- return the intersection of two lists
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Intersection(l1, l2)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>l1</tt></b>, <b><tt>l2</tt></b> -- two lists
<p>
<h5>
Description:
</h5>
The intersection of the lists "l1" and "l2" is determined and
returned. The intersection contains all elements that occur in both
lists. The entries in the result are listed in the same order as in
"l1". If an expression occurs multiple times in both "l1" and
"l2", then it will occur the same number of times in the result.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Intersection({a,b,c}, {b,c,d});
Out> {b,c};
In> Intersection({a,e,i,o,u}, {f,o,u,r,t,e,e,n});
Out> {e,o,u};
In> Intersection({1,2,2,3,3,3}, {1,1,2,2,3,3});
Out> {1,2,2,3,3};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Union" target="Chapters">
Union
</a>
, <a href="ref.html?Difference" target="Chapters">
Difference
</a>
.<a name="Union">
</a>
<a name="union">
</a>
<h3>
<hr>Union -- return the union of two lists
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Union(l1, l2)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>l1</tt></b>, <b><tt>l2</tt></b> -- two lists
<p>
<h5>
Description:
</h5>
The union of the lists "l1" and "l2" is determined and
returned. The union contains all elements that occur in one or both of
the lists. In the resulting list, any element will occur only once.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Union({a,b,c}, {b,c,d});
Out> {a,b,c,d};
In> Union({a,e,i,o,u}, {f,o,u,r,t,e,e,n});
Out> {a,e,i,o,u,f,r,t,n};
In> Union({1,2,2,3,3,3}, {2,2,3,3,4,4});
Out> {1,2,3,4};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Intersection" target="Chapters">
Intersection
</a>
, <a href="ref.html?Difference" target="Chapters">
Difference
</a>
.<a name="Difference">
</a>
<a name="difference">
</a>
<h3>
<hr>Difference -- return the difference of two lists
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Difference(l1, l2)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>l1</tt></b>, <b><tt>l2</tt></b> -- two lists
<p>
<h5>
Description:
</h5>
The difference of the lists "l1" and "l2" is determined and
returned. The difference contains all elements that occur in "l1"
but not in "l2". The order of elements in "l1" is preserved. If a
certain expression occurs "n1" times in the first list and "n2"
times in the second list, it will occur "n1-n2" times in the result
if "n1" is greater than "n2" and not at all otherwise.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Difference({a,b,c}, {b,c,d});
Out> {a};
In> Difference({a,e,i,o,u}, {f,o,u,r,t,e,e,n});
Out> {a,i};
In> Difference({1,2,2,3,3,3}, {2,2,3,4,4});
Out> {1,3,3};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Intersection" target="Chapters">
Intersection
</a>
, <a href="ref.html?Union" target="Chapters">
Union
</a>
.<a name="FillList">
</a>
<a name="filllist">
</a>
<h3>
<hr>FillList -- fill a list with a certain expression
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
FillList(expr, n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr</tt></b> -- expression to fill the list with
<p>
<b><tt>n</tt></b> -- the length of the list to construct
<p>
<h5>
Description:
</h5>
This command creates a list of length "n" in which all slots contain
the expression "expr" and returns this list.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> FillList(x, 5);
Out> {x,x,x,x,x};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?MakeVector" target="Chapters">
MakeVector
</a>
, <a href="ref.html?ZeroVector" target="Chapters">
ZeroVector
</a>
, <a href="ref.html?RandomIntegerVector" target="Chapters">
RandomIntegerVector
</a>
.<a name="Drop">
</a>
<a name="drop">
</a>
<h3>
<hr>Drop -- drop a range of elements from a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Drop(list, n)
Drop(list, -n)
Drop(list, {m,n})
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to act on
<p>
<b><tt>n</tt></b>, <b><tt>m</tt></b> -- positive integers describing the entries to drop
<p>
<h5>
Description:
</h5>
This command removes a sublist of "list" and returns a list
containing the remaining entries. The first calling sequence drops the
first "n" entries in "list". The second form drops the last "n"
entries. The last invocation drops the elements with indices "m"
through "n".
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d,e,f,g};
Out> {a,b,c,d,e,f,g};
In> Drop(lst, 2);
Out> {c,d,e,f,g};
In> Drop(lst, -3);
Out> {a,b,c,d};
In> Drop(lst, {2,4});
Out> {a,e,f,g};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Take" target="Chapters">
Take
</a>
, <a href="ref.html?Select" target="Chapters">
Select
</a>
, <a href="ref.html?Remove" target="Chapters">
Remove
</a>
.<a name="Take">
</a>
<a name="take">
</a>
<h3>
<hr>Take -- take a sublist from a list, dropping the rest
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Take(list, n)
Take(list, -n)
Take(list, {m,n})
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to act on
<p>
<b><tt>n</tt></b>, <b><tt>m</tt></b> -- positive integers describing the entries to take
<p>
<h5>
Description:
</h5>
This command takes a sublist of "list", drops the rest, and returns
the selected sublist. The first calling sequence selects the first
"n" entries in "list". The second form takes the last "n"
entries. The last invocation selects the sublist beginning with entry
number "m" and ending with the "n"-th entry.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> lst := {a,b,c,d,e,f,g};
Out> {a,b,c,d,e,f,g};
In> Take(lst, 2);
Out> {a,b};
In> Take(lst, -3);
Out> {e,f,g};
In> Take(lst, {2,4});
Out> {b,c,d};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Drop" target="Chapters">
Drop
</a>
, <a href="ref.html?Select" target="Chapters">
Select
</a>
, <a href="ref.html?Remove" target="Chapters">
Remove
</a>
.<a name="Partition">
</a>
<a name="partition">
</a>
<h3>
<hr>Partition -- partition a list in sublists of equal length
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Partition(list, n)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to partition
<p>
<b><tt>n</tt></b> -- length of partitions
<p>
<h5>
Description:
</h5>
This command partitions "list" into non-overlapping sublists of
length "n" and returns a list of these sublists. The first "n"
entries in "list" form the first partition, the entries from
position "n+1" up to "2n" form the second partition, and so on. If
"n" does not divide the length of "list", the remaining entries
will be thrown away. If "n" equals zero, an empty list is
returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Partition({a,b,c,d,e,f,}, 2);
Out> {{a,b},{c,d},{e,f}};
In> Partition(1 .. 11, 3);
Out> {{1,2,3},{4,5,6},{7,8,9}};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Take" target="Chapters">
Take
</a>
, <a href="ref.html?Permutations" target="Chapters">
Permutations
</a>
.<a name="Assoc">
</a>
<a name="assoc">
</a>
<h3>
<hr>Assoc -- return element stored in association list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Assoc(key, alist)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>key</tt></b> -- string, key under which element is stored
<p>
<b><tt>alist</tt></b> -- association list to examine
<p>
<h5>
Description:
</h5>
The association list "alist" is searched for an entry stored with
index "key". If such an entry is found, it is returned. Otherwise
the atom <b><tt>Empty</tt></b> is returned.
<p>
Association lists are represented as a list of two-entry lists. The
first element in the two-entry list is the key, the second element is
the value stored under this key.
<p>
The call <b><tt>Assoc(key, alist)</tt></b> can (probably more
intuitively) be accessed as <b><tt>alist[key]</tt></b>.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> writer := {};
Out> {};
In> writer["Iliad"] := "Homer";
Out> True;
In> writer["Henry IV"] := "Shakespeare";
Out> True;
In> writer["Ulysses"] := "James Joyce";
Out> True;
In> Assoc("Henry IV", writer);
Out> {"Henry IV","Shakespeare"};
In> Assoc("War and Peace", writer);
Out> Empty;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?AssocIndices" target="Chapters">
AssocIndices
</a>
, <a href="ref.html?[]" target="Chapters">
[]
</a>
, <a href="ref.html?:=" target="Chapters">
:=
</a>
, <a href="ref.html?AssocDelete" target="Chapters">
AssocDelete
</a>
.<a name="AssocIndices">
</a>
<a name="associndices">
</a>
<h3>
<hr>AssocIndices -- return the keys in an association list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
AssocIndices(alist)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>alist</tt></b> -- association list to examine
<p>
<h5>
Description:
</h5>
All the keys in the association list "alist" are assembled in a list
and this list is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> writer := {};
Out> {};
In> writer["Iliad"] := "Homer";
Out> True;
In> writer["Henry IV"] := "Shakespeare";
Out> True;
In> writer["Ulysses"] := "James Joyce";
Out> True;
In> AssocIndices(writer);
Out> {"Iliad","Henry IV","Ulysses"};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Assoc" target="Chapters">
Assoc
</a>
, <a href="ref.html?AssocDelete" target="Chapters">
AssocDelete
</a>
.<a name="AssocDelete">
</a>
<a name="assocdelete">
</a>
<h3>
<hr>AssocDelete -- delete an entry in an association list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
AssocDelete(alist, "key")
AssocDelete(alist, {key, value})
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>alist</tt></b> -- association list
<p>
<b><tt>"key"</tt></b> -- string, association key
<p>
<b><tt>value</tt></b> -- value of the key to be deleted
<p>
<h5>
Description:
</h5>
The key <b><tt>"key"</tt></b> in the association list <b><tt>alist</tt></b> is deleted. (The list itself is modified.) If the key was found and successfully deleted, returns <b><tt>True</tt></b>, otherwise if the given key was not found, the function returns <b><tt>False</tt></b>.
<p>
The second, longer form of the function deletes the entry that has both the
specified key and the specified value. It can be used for two purposes:
<ul><li>to make sure that we are deleting the right value;
</li><li>if several values are stored on the same key, to delete the specified entry (see the last example).
</li></ul>
<p>
At most one entry is deleted.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> writer := {};
Out> {};
In> writer["Iliad"] := "Homer";
Out> True;
In> writer["Henry IV"] := "Shakespeare";
Out> True;
In> writer["Ulysses"] := "James Joyce";
Out> True;
In> AssocDelete(writer, "Henry IV")
Out> True;
In> AssocDelete(writer, "Henry XII")
Out> False;
In> writer
Out> {{"Ulysses","James Joyce"},
{"Iliad","Homer"}};
In> DestructiveAppend(writer,
{"Ulysses", "Dublin"});
Out> {{"Iliad","Homer"},{"Ulysses","James Joyce"},
{"Ulysses","Dublin"}};
In> writer["Ulysses"];
Out> "James Joyce";
In> AssocDelete(writer,{"Ulysses","James Joyce"});
Out> True;
In> writer
Out> {{"Iliad","Homer"},{"Ulysses","Dublin"}};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Assoc" target="Chapters">
Assoc
</a>
, <a href="ref.html?AssocIndices" target="Chapters">
AssocIndices
</a>
.<a name="Flatten">
</a>
<a name="flatten">
</a>
<h3>
<hr>Flatten -- flatten expression w.r.t. some operator
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Flatten(expression,operator)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expression</tt></b> -- an expression
<p>
<b><tt>operator</tt></b> -- string with the contents of an infix operator.
<p>
<h5>
Description:
</h5>
Flatten flattens an expression with respect to a specific
operator, converting the result into a list.
This is useful for unnesting an expression. Flatten is typically
used in simple simplification schemes.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Flatten(a+b*c+d,"+");
Out> {a,b*c,d};
In> Flatten({a,{b,c},d},"List");
Out> {a,b,c,d};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?UnFlatten" target="Chapters">
UnFlatten
</a>
.<a name="UnFlatten">
</a>
<a name="unflatten">
</a>
<h3>
<hr>UnFlatten -- inverse operation of Flatten
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
UnFlatten(list,operator,identity)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list of objects the operator is to work on
<p>
<b><tt>operator</tt></b> -- infix operator
<p>
<b><tt>identity</tt></b> -- identity of the operator
<p>
<h5>
Description:
</h5>
UnFlatten is the inverse operation of Flatten. Given
a list, it can be turned into an expression representing
for instance the addition of these elements by calling
UnFlatten with "+" as argument to operator, and 0 as
argument to identity (0 is the identity for addition, since
a+0=a). For multiplication the identity element would be 1.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> UnFlatten({a,b,c},"+",0)
Out> a+b+c;
In> UnFlatten({a,b,c},"*",1)
Out> a*b*c;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Flatten" target="Chapters">
Flatten
</a>
.<a name="Type">
</a>
<a name="type">
</a>
<h3>
<hr>Type -- return the type of an expression
</h3>
<h5 align=right>Internal function</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Type(expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr</tt></b> -- expression to examine
<p>
<h5>
Description:
</h5>
The type of the expression "expr" is represented as a string and
returned. So, if "expr" is a list, the string <b><tt>"List"</tt></b> is returned. In general, the top-level
operator of "expr" is returned. If the argument "expr" is an atom,
the result is the empty string <b><tt>""</tt></b>.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Type({a,b,c});
Out> "List";
In> Type(a*(b+c));
Out> "*";
In> Type(123);
Out> "";
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?IsAtom" target="Chapters">
IsAtom
</a>
, <a href="ref.html?NrArgs" target="Chapters">
NrArgs
</a>
.<a name="NrArgs">
</a>
<a name="nrargs">
</a>
<h3>
<hr>NrArgs -- return number of top-level arguments
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
NrArgs(expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr</tt></b> -- expression to examine
<p>
<h5>
Description:
</h5>
This function evaluates to the number of top-level arguments of the
expression "expr". The argument "expr" may not be an atom, since
that would lead to an error.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> NrArgs(f(a,b,c))
Out> 3;
In> NrArgs(Sin(x));
Out> 1;
In> NrArgs(a*(b+c));
Out> 2;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Type" target="Chapters">
Type
</a>
, <a href="ref.html?Length" target="Chapters">
Length
</a>
.<a name="VarList">
</a>
<a name="varlist">
</a>
<h3>
<hr>VarList -- list of variables appearing in an expression
</h3>
<a name="VarListArith">
</a>
<a name="varlistarith">
</a>
<h3>
<hr>VarListArith -- list of variables appearing in an expression
</h3>
<a name="VarListSome">
</a>
<a name="varlistsome">
</a>
<h3>
<hr>VarListSome -- list of variables appearing in an expression
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
VarList(expr)
VarListArith(expr)
VarListSome(expr, list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr</tt></b> -- an expression
<p>
<b><tt>list</tt></b> -- a list of function atoms
<p>
<h5>
Description:
</h5>
The command <b><tt>VarList(expr)</tt></b> returns a list of all variables that appear in the
expression <b><tt>expr</tt></b>. The expression is traversed recursively.
<p>
The command <b><tt>VarListSome</tt></b> looks only at arguments of functions in the <b><tt>list</tt></b>. All other functions are considered "opaque" (as if they do not contain any variables) and their arguments are not checked.
For example, <b><tt>VarListSome(a + Sin(b-c))</tt></b> will return <b><tt>{a, b, c}</tt></b>, but <b><tt>VarListSome(a*Sin(b-c), {*})</tt></b> will not look at arguments of <b><tt>Sin()</tt></b> and will return <b><tt>{a,Sin(b-c)}</tt></b>. Here <b><tt>Sin(b-c)</tt></b> is considered a "variable" because the function <b><tt>Sin</tt></b> does not belong to <b><tt>list</tt></b>.
<p>
The command <b><tt>VarListArith</tt></b> returns a list of all variables that appear
arithmetically in the expression <b><tt>expr</tt></b>. This is implemented through
<b><tt>VarListSome</tt></b> by restricting to the arithmetic functions <b><tt>+</tt></b>, <b><tt>-</tt></b>, <b><tt>*</tt></b>, <b><tt>/</tt></b>.
Arguments of other functions are not checked.
<p>
Note that since the operators "<b><tt>+</tt></b>" and "<b><tt>-</tt></b>" are prefix as well as infix operators, it is currently required to use <b><tt>Atom("+")</tt></b> to obtain the unevaluated atom "<b><tt>+</tt></b>".
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> VarList(Sin(x))
Out> {x};
In> VarList(x+a*y)
Out> {x,a,y};
In> VarListSome(x+a*y, {Atom("+")})
Out> {x,a*y};
In> VarListArith(x+y*Cos(Ln(x)/x))
Out> {x,y,Cos(Ln(x)/x)}
In> VarListArith(x+a*y^2-1)
Out> {x,a,y^2};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?IsFreeOf" target="Chapters">
IsFreeOf
</a>
, <a href="ref.html?IsVariable" target="Chapters">
IsVariable
</a>
, <a href="ref.html?FuncList" target="Chapters">
FuncList
</a>
, <a href="ref.html?HasExpr" target="Chapters">
HasExpr
</a>
, <a href="ref.html?HasFunc" target="Chapters">
HasFunc
</a>
.<a name="FuncList">
</a>
<a name="funclist">
</a>
<h3>
<hr>FuncList -- list of functions used in an expression
</h3>
<a name="FuncListArith">
</a>
<a name="funclistarith">
</a>
<h3>
<hr>FuncListArith -- list of functions used in an expression
</h3>
<a name="FuncListSome">
</a>
<a name="funclistsome">
</a>
<h3>
<hr>FuncListSome -- list of functions used in an expression
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
FuncList(expr)
FuncListArith(expr)
FuncListSome(expr, list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>expr</tt></b> -- an expression
<p>
<b><tt>list</tt></b> -- list of function atoms to be considered "transparent"
<p>
<h5>
Description:
</h5>
The command <b><tt>FuncList(expr)</tt></b> returns a list of all function atoms that appear
in the expression <b><tt>expr</tt></b>. The expression is recursively traversed.
<p>
The command <b><tt>FuncListSome(expr, list)</tt></b> does the same, except it only looks at arguments of a given <b><tt>list</tt></b> of functions. All other functions become "opaque" (as if they do not contain any other functions).
For example, <b><tt>FuncListSome(a + Sin(b-c))</tt></b> will see that the expression has a "<b><tt>-</tt></b>" operation and return <b><tt>{+,Sin,-}</tt></b>, but <b><tt>FuncListSome(a + Sin(b-c), {+})</tt></b> will not look at arguments of <b><tt>Sin()</tt></b> and will return <b><tt>{+,Sin}</tt></b>.
<p>
<b><tt>FuncListArith</tt></b> is defined through <b><tt>FuncListSome</tt></b> to look only at arithmetic operations <b><tt>+</tt></b>, <b><tt>-</tt></b>, <b><tt>*</tt></b>, <b><tt>/</tt></b>.
<p>
Note that since the operators "<b><tt>+</tt></b>" and "<b><tt>-</tt></b>" are prefix as well as infix operators, it is currently required to use <b><tt>Atom("+")</tt></b> to obtain the unevaluated atom "<b><tt>+</tt></b>".
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> FuncList(x+y*Cos(Ln(x)/x))
Out> {+,*,Cos,/,Ln};
In> FuncListArith(x+y*Cos(Ln(x)/x))
Out> {+,*,Cos};
In> FuncListSome({a+b*2,c/d},{List})
Out> {List,+,/};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?VarList" target="Chapters">
VarList
</a>
, <a href="ref.html?HasExpr" target="Chapters">
HasExpr
</a>
, <a href="ref.html?HasFunc" target="Chapters">
HasFunc
</a>
.<a name="BubbleSort">
</a>
<a name="bubblesort">
</a>
<h3>
<hr>BubbleSort -- sort a list
</h3>
<a name="HeapSort">
</a>
<a name="heapsort">
</a>
<h3>
<hr>HeapSort -- sort a list
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
BubbleSort(list, compare)
HeapSort(list, compare)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to sort
<p>
<b><tt>compare</tt></b> -- function used to compare elements of <b><tt>list</tt></b>
<p>
<h5>
Description:
</h5>
This command returns <b><tt>list</tt></b> after it is sorted using <b><tt>compare</tt></b> to
compare elements. The function <b><tt>compare</tt></b> should accept two arguments,
which will be elements of <b><tt>list</tt></b>, and compare them. It should return
<b><tt>True</tt></b> if in the sorted list the second argument
should come after the first one, and <b><tt>False</tt></b>
otherwise.
<p>
The function <b><tt>BubbleSort</tt></b> uses the so-called "bubble sort" algorithm to do the
sorting by swapping elements that are out of order. This algorithm is easy to
implement, though it is not particularly fast. The sorting time is proportional
to <b> n^2</b> where <b> n</b> is the length of the list.
<p>
The function <b><tt>HeapSort</tt></b> uses a recursive algorithm "heapsort" and is much
faster for large lists. The sorting time is proportional to <b> n*Ln(n)</b> where <b>n</b>
is the length of the list.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> BubbleSort({4,7,23,53,-2,1}, "<");
Out> {-2,1,4,7,23,53};
In> HeapSort({4,7,23,53,-2,1}, ">");
Out> {53,23,7,4,1,-2};
</pre></tr>
</table>
<p>
<a name="PrintList">
</a>
<a name="printlist">
</a>
<h3>
<hr>PrintList -- print list with padding
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
PrintList(list)
PrintList(list, padding);
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- a list to be printed
<p>
<b><tt>padding</tt></b> -- (optional) a string
<p>
<h5>
Description:
</h5>
Prints <b><tt>list</tt></b> and inserts the <b><tt>padding</tt></b> string between each pair of items of the list. Items of the list which are strings are printed without quotes, unlike <b><tt>Write()</tt></b>. Items of the list which are themselves lists are printed inside braces <b><tt>{}</tt></b>. If padding is not specified, a standard one is used (comma, space).
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> PrintList({a,b,{c, d}}, " .. ")
Out> " a .. b .. { c .. d}";
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Write" target="Chapters">
Write
</a>
, <a href="ref.html?WriteString" target="Chapters">
WriteString
</a>
.<a name="Table">
</a>
<a name="table">
</a>
<h3>
<hr>Table -- evaluate while some variable ranges over interval
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
Table(body, var, from, to, step)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>body</tt></b> -- expression to evaluate multiple times
<p>
<b><tt>var</tt></b> -- variable to use as loop variable
<p>
<b><tt>from</tt></b> -- initial value for "var"
<p>
<b><tt>to</tt></b> -- final value for "var"
<p>
<b><tt>step</tt></b> -- step size with which "var" is incremented
<p>
<h5>
Description:
</h5>
This command generates a list of values from "body", by assigning
variable "var" values from "from" up to "to", incrementing
"step" each time. So, the variable "var" first gets the value
"from", and the expression "body" is evaluated. Then the value
"from"+"step" is assigned to "var" and the expression "body"
is again evaluated. This continues, incrementing "var" with "step"
on every iteration, until "var" exceeds "to". At that moment, all
the results are assembled in a list and this list is returned.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> Table(i!, i, 1, 9, 1);
Out> {1,2,6,24,120,720,5040,40320,362880};
In> Table(i, i, 3, 16, 4);
Out> {3,7,11,15};
In> Table(i^2, i, 10, 1, -1);
Out> {100,81,64,49,36,25,16,9,4,1};
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?For" target="Chapters">
For
</a>
, <a href="ref.html?MapSingle" target="Chapters">
MapSingle
</a>
, <a href="ref.html?.." target="Chapters">
..
</a>
, <a href="ref.html?TableForm" target="Chapters">
TableForm
</a>
.<a name="TableForm">
</a>
<a name="tableform">
</a>
<h3>
<hr>TableForm -- print each entry in a list on a line
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
TableForm(list)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>list</tt></b> -- list to print
<p>
<h5>
Description:
</h5>
This functions writes out the list <b><tt>list</tt></b> in a better readable form, by
printing every element in the list on a separate line.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> TableForm(Table(i!, i, 1, 10, 1));
</pre></tr>
</table>
<p>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
1
2
6
24
120
720
5040
40320
362880
3628800
Out> True;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?PrettyForm" target="Chapters">
PrettyForm
</a>
, <a href="ref.html?Echo" target="Chapters">
Echo
</a>
, <a href="ref.html?Table" target="Chapters">
Table
</a>
.<a name="GlobalPop">
</a>
<a name="globalpop">
</a>
<h3>
<hr>GlobalPop -- restore variables using a global stack
</h3>
<a name="GlobalPush">
</a>
<a name="globalpush">
</a>
<h3>
<hr>GlobalPush -- save variables using a global stack
</h3>
<h5 align=right>Standard library</h5><h5>
Calling format:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
GlobalPop(var)
GlobalPop()
GlobalPush(expr)
</pre></tr>
</table>
<p>
<h5>
Parameters:
</h5>
<b><tt>var</tt></b> -- atom, name of variable to restore from the stack
<p>
<b><tt>expr</tt></b> -- expression, value to save on the stack
<p>
<h5>
Description:
</h5>
These functions operate with a global stack, currently implemented as a list that is not accessible externally (it is protected
through <b><tt>LocalSymbols</tt></b>).
<p>
<b><tt>GlobalPush</tt></b> stores a value on the stack. <b><tt>GlobalPop</tt></b> removes the last pushed value from the stack. If a variable name is given, the variable is assigned, otherwise the popped value is returned.
<p>
If the global stack is empty, an error message is printed.
<p>
<h5>
Examples:
</h5>
<table cellpadding="0" width="100%">
<tr><td width=100% bgcolor="#DDDDEE"><pre>
In> GlobalPush(3)
Out> 3;
In> GlobalPush(Sin(x))
Out> Sin(x);
In> GlobalPop(x)
Out> Sin(x);
In> GlobalPop(x)
Out> 3;
In> x
Out> 3;
</pre></tr>
</table>
<p>
<h5>
See also:
</h5>
<a href="ref.html?Push" target="Chapters">
Push
</a>
, <a href="ref.html?PopFront" target="Chapters">
PopFront
</a>
.
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2425144-1";
urchinTracker();
</script>
</body>
</html>
|