Mercurial > emacs
comparison src/eval.c @ 3703:6930e8f81c88
(call5, call6): New functions.
(call1, call2, call3, call4): Renumber the args.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 13 Jun 1993 00:01:22 +0000 |
parents | 3c4b5489d2b4 |
children | ab06b106c490 |
comparison
equal
deleted
inserted
replaced
3702:5bcb8bd982d0 | 3703:6930e8f81c88 |
---|---|
1734 | 1734 |
1735 GCPRO1 (fn); | 1735 GCPRO1 (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)); |
1754 #else /* not NO_ARG_ARRAY */ | 1754 #else /* not NO_ARG_ARRAY */ |
1755 GCPRO1 (fn); | 1755 GCPRO1 (fn); |
1756 gcpro1.nvars = 2; | 1756 gcpro1.nvars = 2; |
1757 RETURN_UNGCPRO (Ffuncall (2, &fn)); | 1757 RETURN_UNGCPRO (Ffuncall (2, &fn)); |
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)); |
1776 #else /* not NO_ARG_ARRAY */ | 1776 #else /* not NO_ARG_ARRAY */ |
1777 GCPRO1 (fn); | 1777 GCPRO1 (fn); |
1778 gcpro1.nvars = 3; | 1778 gcpro1.nvars = 3; |
1779 RETURN_UNGCPRO (Ffuncall (3, &fn)); | 1779 RETURN_UNGCPRO (Ffuncall (3, &fn)); |
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)); |
1799 #else /* not NO_ARG_ARRAY */ | 1799 #else /* not NO_ARG_ARRAY */ |
1800 GCPRO1 (fn); | 1800 GCPRO1 (fn); |
1801 gcpro1.nvars = 4; | 1801 gcpro1.nvars = 4; |
1802 RETURN_UNGCPRO (Ffuncall (4, &fn)); | 1802 RETURN_UNGCPRO (Ffuncall (4, &fn)); |
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)); |
1823 #else /* not NO_ARG_ARRAY */ | 1823 #else /* not NO_ARG_ARRAY */ |
1824 GCPRO1 (fn); | 1824 GCPRO1 (fn); |
1825 gcpro1.nvars = 5; | 1825 gcpro1.nvars = 5; |
1826 RETURN_UNGCPRO (Ffuncall (5, &fn)); | 1826 RETURN_UNGCPRO (Ffuncall (5, &fn)); |
1827 #endif /* not NO_ARG_ARRAY */ | |
1828 } | |
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)); | |
1827 #endif /* not NO_ARG_ARRAY */ | 1878 #endif /* not NO_ARG_ARRAY */ |
1828 } | 1879 } |
1829 | 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\ |