diff options
| author | Richard M. Stallman | 1993-06-13 00:01:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-13 00:01:22 +0000 |
| commit | 15285f9fa7d994583488ba5fbab32958af4175a7 (patch) | |
| tree | 78df35f2558cb202c85da0eaaf21d951dd25755d /src | |
| parent | bcd54802d58f297e4b664a00af12452e91da3687 (diff) | |
| download | emacs-15285f9fa7d994583488ba5fbab32958af4175a7.tar.gz emacs-15285f9fa7d994583488ba5fbab32958af4175a7.zip | |
(call5, call6): New functions.
(call1, call2, call3, call4): Renumber the args.
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 95 |
1 files changed, 73 insertions, 22 deletions
diff --git a/src/eval.c b/src/eval.c index 476f663f09f..97245f09c82 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1736,18 +1736,18 @@ call0 (fn) | |||
| 1736 | RETURN_UNGCPRO (Ffuncall (1, &fn)); | 1736 | RETURN_UNGCPRO (Ffuncall (1, &fn)); |
| 1737 | } | 1737 | } |
| 1738 | 1738 | ||
| 1739 | /* Call function fn with argument arg */ | 1739 | /* Call function fn with 1 argument arg1 */ |
| 1740 | /* ARGSUSED */ | 1740 | /* ARGSUSED */ |
| 1741 | Lisp_Object | 1741 | Lisp_Object |
| 1742 | call1 (fn, arg) | 1742 | call1 (fn, arg1) |
| 1743 | Lisp_Object fn, arg; | 1743 | Lisp_Object fn, arg1; |
| 1744 | { | 1744 | { |
| 1745 | struct gcpro gcpro1; | 1745 | struct gcpro gcpro1; |
| 1746 | #ifdef NO_ARG_ARRAY | 1746 | #ifdef NO_ARG_ARRAY |
| 1747 | Lisp_Object args[2]; | 1747 | Lisp_Object args[2]; |
| 1748 | 1748 | ||
| 1749 | args[0] = fn; | 1749 | args[0] = fn; |
| 1750 | args[1] = arg; | 1750 | args[1] = arg1; |
| 1751 | GCPRO1 (args[0]); | 1751 | GCPRO1 (args[0]); |
| 1752 | gcpro1.nvars = 2; | 1752 | gcpro1.nvars = 2; |
| 1753 | RETURN_UNGCPRO (Ffuncall (2, args)); | 1753 | RETURN_UNGCPRO (Ffuncall (2, args)); |
| @@ -1758,18 +1758,18 @@ call1 (fn, arg) | |||
| 1758 | #endif /* not NO_ARG_ARRAY */ | 1758 | #endif /* not NO_ARG_ARRAY */ |
| 1759 | } | 1759 | } |
| 1760 | 1760 | ||
| 1761 | /* Call function fn with arguments arg, arg1 */ | 1761 | /* Call function fn with 2 arguments arg1, arg2 */ |
| 1762 | /* ARGSUSED */ | 1762 | /* ARGSUSED */ |
| 1763 | Lisp_Object | 1763 | Lisp_Object |
| 1764 | call2 (fn, arg, arg1) | 1764 | call2 (fn, arg1, arg2) |
| 1765 | Lisp_Object fn, arg, arg1; | 1765 | Lisp_Object fn, arg1, arg2; |
| 1766 | { | 1766 | { |
| 1767 | struct gcpro gcpro1; | 1767 | struct gcpro gcpro1; |
| 1768 | #ifdef NO_ARG_ARRAY | 1768 | #ifdef NO_ARG_ARRAY |
| 1769 | Lisp_Object args[3]; | 1769 | Lisp_Object args[3]; |
| 1770 | args[0] = fn; | 1770 | args[0] = fn; |
| 1771 | args[1] = arg; | 1771 | args[1] = arg1; |
| 1772 | args[2] = arg1; | 1772 | args[2] = arg2; |
| 1773 | GCPRO1 (args[0]); | 1773 | GCPRO1 (args[0]); |
| 1774 | gcpro1.nvars = 3; | 1774 | gcpro1.nvars = 3; |
| 1775 | RETURN_UNGCPRO (Ffuncall (3, args)); | 1775 | RETURN_UNGCPRO (Ffuncall (3, args)); |
| @@ -1780,19 +1780,19 @@ call2 (fn, arg, arg1) | |||
| 1780 | #endif /* not NO_ARG_ARRAY */ | 1780 | #endif /* not NO_ARG_ARRAY */ |
| 1781 | } | 1781 | } |
| 1782 | 1782 | ||
| 1783 | /* Call function fn with arguments arg, arg1, arg2 */ | 1783 | /* Call function fn with 3 arguments arg1, arg2, arg3 */ |
| 1784 | /* ARGSUSED */ | 1784 | /* ARGSUSED */ |
| 1785 | Lisp_Object | 1785 | Lisp_Object |
| 1786 | call3 (fn, arg, arg1, arg2) | 1786 | call3 (fn, arg1, arg2, arg3) |
| 1787 | Lisp_Object fn, arg, arg1, arg2; | 1787 | Lisp_Object fn, arg1, arg2, arg3; |
| 1788 | { | 1788 | { |
| 1789 | struct gcpro gcpro1; | 1789 | struct gcpro gcpro1; |
| 1790 | #ifdef NO_ARG_ARRAY | 1790 | #ifdef NO_ARG_ARRAY |
| 1791 | Lisp_Object args[4]; | 1791 | Lisp_Object args[4]; |
| 1792 | args[0] = fn; | 1792 | args[0] = fn; |
| 1793 | args[1] = arg; | 1793 | args[1] = arg1; |
| 1794 | args[2] = arg1; | 1794 | args[2] = arg2; |
| 1795 | args[3] = arg2; | 1795 | args[3] = arg3; |
| 1796 | GCPRO1 (args[0]); | 1796 | GCPRO1 (args[0]); |
| 1797 | gcpro1.nvars = 4; | 1797 | gcpro1.nvars = 4; |
| 1798 | RETURN_UNGCPRO (Ffuncall (4, args)); | 1798 | RETURN_UNGCPRO (Ffuncall (4, args)); |
| @@ -1803,20 +1803,20 @@ call3 (fn, arg, arg1, arg2) | |||
| 1803 | #endif /* not NO_ARG_ARRAY */ | 1803 | #endif /* not NO_ARG_ARRAY */ |
| 1804 | } | 1804 | } |
| 1805 | 1805 | ||
| 1806 | /* Call function fn with arguments arg, arg1, arg2, arg3 */ | 1806 | /* Call function fn with 4 arguments arg1, arg2, arg3, arg4 */ |
| 1807 | /* ARGSUSED */ | 1807 | /* ARGSUSED */ |
| 1808 | Lisp_Object | 1808 | Lisp_Object |
| 1809 | call4 (fn, arg, arg1, arg2, arg3) | 1809 | call4 (fn, arg1, arg2, arg3, arg4) |
| 1810 | Lisp_Object fn, arg, arg1, arg2, arg3; | 1810 | Lisp_Object fn, arg1, arg2, arg3, arg4; |
| 1811 | { | 1811 | { |
| 1812 | struct gcpro gcpro1; | 1812 | struct gcpro gcpro1; |
| 1813 | #ifdef NO_ARG_ARRAY | 1813 | #ifdef NO_ARG_ARRAY |
| 1814 | Lisp_Object args[5]; | 1814 | Lisp_Object args[5]; |
| 1815 | args[0] = fn; | 1815 | args[0] = fn; |
| 1816 | args[1] = arg; | 1816 | args[1] = arg1; |
| 1817 | args[2] = arg1; | 1817 | args[2] = arg2; |
| 1818 | args[3] = arg2; | 1818 | args[3] = arg3; |
| 1819 | args[4] = arg3; | 1819 | args[4] = arg4; |
| 1820 | GCPRO1 (args[0]); | 1820 | GCPRO1 (args[0]); |
| 1821 | gcpro1.nvars = 5; | 1821 | gcpro1.nvars = 5; |
| 1822 | RETURN_UNGCPRO (Ffuncall (5, args)); | 1822 | RETURN_UNGCPRO (Ffuncall (5, args)); |
| @@ -1827,6 +1827,57 @@ call4 (fn, arg, arg1, arg2, arg3) | |||
| 1827 | #endif /* not NO_ARG_ARRAY */ | 1827 | #endif /* not NO_ARG_ARRAY */ |
| 1828 | } | 1828 | } |
| 1829 | 1829 | ||
| 1830 | /* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5 */ | ||
| 1831 | /* ARGSUSED */ | ||
| 1832 | Lisp_Object | ||
| 1833 | call5 (fn, arg1, arg2, arg3, arg4, arg5) | ||
| 1834 | Lisp_Object fn, arg1, arg2, arg3, arg4, arg5; | ||
| 1835 | { | ||
| 1836 | struct gcpro gcpro1; | ||
| 1837 | #ifdef NO_ARG_ARRAY | ||
| 1838 | Lisp_Object args[6]; | ||
| 1839 | args[0] = fn; | ||
| 1840 | args[1] = arg1; | ||
| 1841 | args[2] = arg2; | ||
| 1842 | args[3] = arg3; | ||
| 1843 | args[4] = arg4; | ||
| 1844 | args[5] = arg5; | ||
| 1845 | GCPRO1 (args[0]); | ||
| 1846 | gcpro1.nvars = 6; | ||
| 1847 | RETURN_UNGCPRO (Ffuncall (6, args)); | ||
| 1848 | #else /* not NO_ARG_ARRAY */ | ||
| 1849 | GCPRO1 (fn); | ||
| 1850 | gcpro1.nvars = 6; | ||
| 1851 | RETURN_UNGCPRO (Ffuncall (6, &fn)); | ||
| 1852 | #endif /* not NO_ARG_ARRAY */ | ||
| 1853 | } | ||
| 1854 | |||
| 1855 | /* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6 */ | ||
| 1856 | /* ARGSUSED */ | ||
| 1857 | Lisp_Object | ||
| 1858 | call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6) | ||
| 1859 | Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6; | ||
| 1860 | { | ||
| 1861 | struct gcpro gcpro1; | ||
| 1862 | #ifdef NO_ARG_ARRAY | ||
| 1863 | Lisp_Object args[7]; | ||
| 1864 | args[0] = fn; | ||
| 1865 | args[1] = arg1; | ||
| 1866 | args[2] = arg2; | ||
| 1867 | args[3] = arg3; | ||
| 1868 | args[4] = arg4; | ||
| 1869 | args[5] = arg5; | ||
| 1870 | args[6] = arg6; | ||
| 1871 | GCPRO1 (args[0]); | ||
| 1872 | gcpro1.nvars = 7; | ||
| 1873 | RETURN_UNGCPRO (Ffuncall (7, args)); | ||
| 1874 | #else /* not NO_ARG_ARRAY */ | ||
| 1875 | GCPRO1 (fn); | ||
| 1876 | gcpro1.nvars = 7; | ||
| 1877 | RETURN_UNGCPRO (Ffuncall (7, &fn)); | ||
| 1878 | #endif /* not NO_ARG_ARRAY */ | ||
| 1879 | } | ||
| 1880 | |||
| 1830 | DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, | 1881 | DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, |
| 1831 | "Call first argument as a function, passing remaining arguments to it.\n\ | 1882 | "Call first argument as a function, passing remaining arguments to it.\n\ |
| 1832 | Thus, (funcall 'cons 'x 'y) returns (x . y).") | 1883 | Thus, (funcall 'cons 'x 'y) returns (x . y).") |