comparison src/eval.c @ 108116:8cf84fb217cc

merge trunk
author Kenichi Handa <handa@etlken>
date Mon, 26 Apr 2010 10:22:02 +0900
parents 641672d44942
children 514ebf69b289
comparison
equal deleted inserted replaced
108115:cd095471cdae 108116:8cf84fb217cc
2784 2784
2785 GCPRO1 (fn); 2785 GCPRO1 (fn);
2786 if (NILP (arg)) 2786 if (NILP (arg))
2787 RETURN_UNGCPRO (Ffuncall (1, &fn)); 2787 RETURN_UNGCPRO (Ffuncall (1, &fn));
2788 gcpro1.nvars = 2; 2788 gcpro1.nvars = 2;
2789 #ifdef NO_ARG_ARRAY
2790 { 2789 {
2791 Lisp_Object args[2]; 2790 Lisp_Object args[2];
2792 args[0] = fn; 2791 args[0] = fn;
2793 args[1] = arg; 2792 args[1] = arg;
2794 gcpro1.var = args; 2793 gcpro1.var = args;
2795 RETURN_UNGCPRO (Fapply (2, args)); 2794 RETURN_UNGCPRO (Fapply (2, args));
2796 } 2795 }
2797 #else /* not NO_ARG_ARRAY */
2798 RETURN_UNGCPRO (Fapply (2, &fn));
2799 #endif /* not NO_ARG_ARRAY */
2800 } 2796 }
2801 2797
2802 /* Call function fn on no arguments */ 2798 /* Call function fn on no arguments */
2803 Lisp_Object 2799 Lisp_Object
2804 call0 (fn) 2800 call0 (fn)
2815 Lisp_Object 2811 Lisp_Object
2816 call1 (fn, arg1) 2812 call1 (fn, arg1)
2817 Lisp_Object fn, arg1; 2813 Lisp_Object fn, arg1;
2818 { 2814 {
2819 struct gcpro gcpro1; 2815 struct gcpro gcpro1;
2820 #ifdef NO_ARG_ARRAY
2821 Lisp_Object args[2]; 2816 Lisp_Object args[2];
2822 2817
2823 args[0] = fn; 2818 args[0] = fn;
2824 args[1] = arg1; 2819 args[1] = arg1;
2825 GCPRO1 (args[0]); 2820 GCPRO1 (args[0]);
2826 gcpro1.nvars = 2; 2821 gcpro1.nvars = 2;
2827 RETURN_UNGCPRO (Ffuncall (2, args)); 2822 RETURN_UNGCPRO (Ffuncall (2, args));
2828 #else /* not NO_ARG_ARRAY */
2829 GCPRO1 (fn);
2830 gcpro1.nvars = 2;
2831 RETURN_UNGCPRO (Ffuncall (2, &fn));
2832 #endif /* not NO_ARG_ARRAY */
2833 } 2823 }
2834 2824
2835 /* Call function fn with 2 arguments arg1, arg2 */ 2825 /* Call function fn with 2 arguments arg1, arg2 */
2836 /* ARGSUSED */ 2826 /* ARGSUSED */
2837 Lisp_Object 2827 Lisp_Object
2838 call2 (fn, arg1, arg2) 2828 call2 (fn, arg1, arg2)
2839 Lisp_Object fn, arg1, arg2; 2829 Lisp_Object fn, arg1, arg2;
2840 { 2830 {
2841 struct gcpro gcpro1; 2831 struct gcpro gcpro1;
2842 #ifdef NO_ARG_ARRAY
2843 Lisp_Object args[3]; 2832 Lisp_Object args[3];
2844 args[0] = fn; 2833 args[0] = fn;
2845 args[1] = arg1; 2834 args[1] = arg1;
2846 args[2] = arg2; 2835 args[2] = arg2;
2847 GCPRO1 (args[0]); 2836 GCPRO1 (args[0]);
2848 gcpro1.nvars = 3; 2837 gcpro1.nvars = 3;
2849 RETURN_UNGCPRO (Ffuncall (3, args)); 2838 RETURN_UNGCPRO (Ffuncall (3, args));
2850 #else /* not NO_ARG_ARRAY */
2851 GCPRO1 (fn);
2852 gcpro1.nvars = 3;
2853 RETURN_UNGCPRO (Ffuncall (3, &fn));
2854 #endif /* not NO_ARG_ARRAY */
2855 } 2839 }
2856 2840
2857 /* Call function fn with 3 arguments arg1, arg2, arg3 */ 2841 /* Call function fn with 3 arguments arg1, arg2, arg3 */
2858 /* ARGSUSED */ 2842 /* ARGSUSED */
2859 Lisp_Object 2843 Lisp_Object
2860 call3 (fn, arg1, arg2, arg3) 2844 call3 (fn, arg1, arg2, arg3)
2861 Lisp_Object fn, arg1, arg2, arg3; 2845 Lisp_Object fn, arg1, arg2, arg3;
2862 { 2846 {
2863 struct gcpro gcpro1; 2847 struct gcpro gcpro1;
2864 #ifdef NO_ARG_ARRAY
2865 Lisp_Object args[4]; 2848 Lisp_Object args[4];
2866 args[0] = fn; 2849 args[0] = fn;
2867 args[1] = arg1; 2850 args[1] = arg1;
2868 args[2] = arg2; 2851 args[2] = arg2;
2869 args[3] = arg3; 2852 args[3] = arg3;
2870 GCPRO1 (args[0]); 2853 GCPRO1 (args[0]);
2871 gcpro1.nvars = 4; 2854 gcpro1.nvars = 4;
2872 RETURN_UNGCPRO (Ffuncall (4, args)); 2855 RETURN_UNGCPRO (Ffuncall (4, args));
2873 #else /* not NO_ARG_ARRAY */
2874 GCPRO1 (fn);
2875 gcpro1.nvars = 4;
2876 RETURN_UNGCPRO (Ffuncall (4, &fn));
2877 #endif /* not NO_ARG_ARRAY */
2878 } 2856 }
2879 2857
2880 /* Call function fn with 4 arguments arg1, arg2, arg3, arg4 */ 2858 /* Call function fn with 4 arguments arg1, arg2, arg3, arg4 */
2881 /* ARGSUSED */ 2859 /* ARGSUSED */
2882 Lisp_Object 2860 Lisp_Object
2883 call4 (fn, arg1, arg2, arg3, arg4) 2861 call4 (fn, arg1, arg2, arg3, arg4)
2884 Lisp_Object fn, arg1, arg2, arg3, arg4; 2862 Lisp_Object fn, arg1, arg2, arg3, arg4;
2885 { 2863 {
2886 struct gcpro gcpro1; 2864 struct gcpro gcpro1;
2887 #ifdef NO_ARG_ARRAY
2888 Lisp_Object args[5]; 2865 Lisp_Object args[5];
2889 args[0] = fn; 2866 args[0] = fn;
2890 args[1] = arg1; 2867 args[1] = arg1;
2891 args[2] = arg2; 2868 args[2] = arg2;
2892 args[3] = arg3; 2869 args[3] = arg3;
2893 args[4] = arg4; 2870 args[4] = arg4;
2894 GCPRO1 (args[0]); 2871 GCPRO1 (args[0]);
2895 gcpro1.nvars = 5; 2872 gcpro1.nvars = 5;
2896 RETURN_UNGCPRO (Ffuncall (5, args)); 2873 RETURN_UNGCPRO (Ffuncall (5, args));
2897 #else /* not NO_ARG_ARRAY */
2898 GCPRO1 (fn);
2899 gcpro1.nvars = 5;
2900 RETURN_UNGCPRO (Ffuncall (5, &fn));
2901 #endif /* not NO_ARG_ARRAY */
2902 } 2874 }
2903 2875
2904 /* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5 */ 2876 /* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5 */
2905 /* ARGSUSED */ 2877 /* ARGSUSED */
2906 Lisp_Object 2878 Lisp_Object
2907 call5 (fn, arg1, arg2, arg3, arg4, arg5) 2879 call5 (fn, arg1, arg2, arg3, arg4, arg5)
2908 Lisp_Object fn, arg1, arg2, arg3, arg4, arg5; 2880 Lisp_Object fn, arg1, arg2, arg3, arg4, arg5;
2909 { 2881 {
2910 struct gcpro gcpro1; 2882 struct gcpro gcpro1;
2911 #ifdef NO_ARG_ARRAY
2912 Lisp_Object args[6]; 2883 Lisp_Object args[6];
2913 args[0] = fn; 2884 args[0] = fn;
2914 args[1] = arg1; 2885 args[1] = arg1;
2915 args[2] = arg2; 2886 args[2] = arg2;
2916 args[3] = arg3; 2887 args[3] = arg3;
2917 args[4] = arg4; 2888 args[4] = arg4;
2918 args[5] = arg5; 2889 args[5] = arg5;
2919 GCPRO1 (args[0]); 2890 GCPRO1 (args[0]);
2920 gcpro1.nvars = 6; 2891 gcpro1.nvars = 6;
2921 RETURN_UNGCPRO (Ffuncall (6, args)); 2892 RETURN_UNGCPRO (Ffuncall (6, args));
2922 #else /* not NO_ARG_ARRAY */
2923 GCPRO1 (fn);
2924 gcpro1.nvars = 6;
2925 RETURN_UNGCPRO (Ffuncall (6, &fn));
2926 #endif /* not NO_ARG_ARRAY */
2927 } 2893 }
2928 2894
2929 /* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6 */ 2895 /* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6 */
2930 /* ARGSUSED */ 2896 /* ARGSUSED */
2931 Lisp_Object 2897 Lisp_Object
2932 call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6) 2898 call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6)
2933 Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6; 2899 Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6;
2934 { 2900 {
2935 struct gcpro gcpro1; 2901 struct gcpro gcpro1;
2936 #ifdef NO_ARG_ARRAY
2937 Lisp_Object args[7]; 2902 Lisp_Object args[7];
2938 args[0] = fn; 2903 args[0] = fn;
2939 args[1] = arg1; 2904 args[1] = arg1;
2940 args[2] = arg2; 2905 args[2] = arg2;
2941 args[3] = arg3; 2906 args[3] = arg3;
2943 args[5] = arg5; 2908 args[5] = arg5;
2944 args[6] = arg6; 2909 args[6] = arg6;
2945 GCPRO1 (args[0]); 2910 GCPRO1 (args[0]);
2946 gcpro1.nvars = 7; 2911 gcpro1.nvars = 7;
2947 RETURN_UNGCPRO (Ffuncall (7, args)); 2912 RETURN_UNGCPRO (Ffuncall (7, args));
2948 #else /* not NO_ARG_ARRAY */
2949 GCPRO1 (fn);
2950 gcpro1.nvars = 7;
2951 RETURN_UNGCPRO (Ffuncall (7, &fn));
2952 #endif /* not NO_ARG_ARRAY */
2953 } 2913 }
2954 2914
2955 /* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7 */ 2915 /* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7 */
2956 /* ARGSUSED */ 2916 /* ARGSUSED */
2957 Lisp_Object 2917 Lisp_Object
2958 call7 (fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7) 2918 call7 (fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
2959 Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7; 2919 Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7;
2960 { 2920 {
2961 struct gcpro gcpro1; 2921 struct gcpro gcpro1;
2962 #ifdef NO_ARG_ARRAY
2963 Lisp_Object args[8]; 2922 Lisp_Object args[8];
2964 args[0] = fn; 2923 args[0] = fn;
2965 args[1] = arg1; 2924 args[1] = arg1;
2966 args[2] = arg2; 2925 args[2] = arg2;
2967 args[3] = arg3; 2926 args[3] = arg3;
2970 args[6] = arg6; 2929 args[6] = arg6;
2971 args[7] = arg7; 2930 args[7] = arg7;
2972 GCPRO1 (args[0]); 2931 GCPRO1 (args[0]);
2973 gcpro1.nvars = 8; 2932 gcpro1.nvars = 8;
2974 RETURN_UNGCPRO (Ffuncall (8, args)); 2933 RETURN_UNGCPRO (Ffuncall (8, args));
2975 #else /* not NO_ARG_ARRAY */
2976 GCPRO1 (fn);
2977 gcpro1.nvars = 8;
2978 RETURN_UNGCPRO (Ffuncall (8, &fn));
2979 #endif /* not NO_ARG_ARRAY */
2980 } 2934 }
2981 2935
2982 /* The caller should GCPRO all the elements of ARGS. */ 2936 /* The caller should GCPRO all the elements of ARGS. */
2983 2937
2984 DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, 2938 DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0,