aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorStefan Monnier2012-11-20 15:06:17 -0500
committerStefan Monnier2012-11-20 15:06:17 -0500
commiteadf1faa3cb5eea8c25a5166a9a97ebd63525c56 (patch)
treec5b92de52e664400cbc79f7dd344cbf440fb7e2a /src/eval.c
parent2e31777bd1354d22319cf6de4085ccc362cff42c (diff)
downloademacs-eadf1faa3cb5eea8c25a5166a9a97ebd63525c56.tar.gz
emacs-eadf1faa3cb5eea8c25a5166a9a97ebd63525c56.zip
Conflate Qnil and Qunbound for `symbol-function'.
* src/alloc.c (Fmake_symbol): Initialize `function' to Qnil. * src/lread.c (init_obarray): Set `function' fields to Qnil. * src/eval.c (Fcommandp): Ignore Qunbound. (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand): * src/data.c (Ffset, Ffboundp, indirect_function, Findirect_function): Test NILP rather than Qunbound. (Ffmakunbound): Set to Qnil. (Fsymbol_function): Never signal an error. (Finteractive_form): Ignore Qunbound.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/eval.c b/src/eval.c
index 053b1a7f097..34b20f6fc8e 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -875,7 +875,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
875 if (NILP (tem)) 875 if (NILP (tem))
876 { 876 {
877 def = XSYMBOL (sym)->function; 877 def = XSYMBOL (sym)->function;
878 if (!EQ (def, Qunbound)) 878 if (!NILP (def))
879 continue; 879 continue;
880 } 880 }
881 break; 881 break;
@@ -890,7 +890,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
890 GCPRO1 (form); 890 GCPRO1 (form);
891 def = Fautoload_do_load (def, sym, Qmacro); 891 def = Fautoload_do_load (def, sym, Qmacro);
892 UNGCPRO; 892 UNGCPRO;
893 if (EQ (def, Qunbound) || !CONSP (def)) 893 if (!CONSP (def))
894 /* Not defined or definition not suitable. */ 894 /* Not defined or definition not suitable. */
895 break; 895 break;
896 if (!EQ (XCAR (def), Qmacro)) 896 if (!EQ (XCAR (def), Qmacro))
@@ -1715,12 +1715,12 @@ then strings and vectors are not accepted. */)
1715 1715
1716 fun = function; 1716 fun = function;
1717 1717
1718 fun = indirect_function (fun); /* Check cycles. */ 1718 fun = indirect_function (fun); /* Check cycles. */
1719 if (NILP (fun) || EQ (fun, Qunbound)) 1719 if (NILP (fun))
1720 return Qnil; 1720 return Qnil;
1721 1721
1722 /* Check an `interactive-form' property if present, analogous to the 1722 /* Check an `interactive-form' property if present, analogous to the
1723 function-documentation property. */ 1723 function-documentation property. */
1724 fun = function; 1724 fun = function;
1725 while (SYMBOLP (fun)) 1725 while (SYMBOLP (fun))
1726 { 1726 {
@@ -1780,7 +1780,7 @@ this does nothing and returns nil. */)
1780 CHECK_STRING (file); 1780 CHECK_STRING (file);
1781 1781
1782 /* If function is defined and not as an autoload, don't override. */ 1782 /* If function is defined and not as an autoload, don't override. */
1783 if (!EQ (XSYMBOL (function)->function, Qunbound) 1783 if (!NILP (XSYMBOL (function)->function)
1784 && !AUTOLOADP (XSYMBOL (function)->function)) 1784 && !AUTOLOADP (XSYMBOL (function)->function))
1785 return Qnil; 1785 return Qnil;
1786 1786
@@ -1959,7 +1959,7 @@ eval_sub (Lisp_Object form)
1959 1959
1960 /* Optimize for no indirection. */ 1960 /* Optimize for no indirection. */
1961 fun = original_fun; 1961 fun = original_fun;
1962 if (SYMBOLP (fun) && !EQ (fun, Qunbound) 1962 if (SYMBOLP (fun) && !NILP (fun)
1963 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 1963 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
1964 fun = indirect_function (fun); 1964 fun = indirect_function (fun);
1965 1965
@@ -2081,7 +2081,7 @@ eval_sub (Lisp_Object form)
2081 val = apply_lambda (fun, original_args); 2081 val = apply_lambda (fun, original_args);
2082 else 2082 else
2083 { 2083 {
2084 if (EQ (fun, Qunbound)) 2084 if (NILP (fun))
2085 xsignal1 (Qvoid_function, original_fun); 2085 xsignal1 (Qvoid_function, original_fun);
2086 if (!CONSP (fun)) 2086 if (!CONSP (fun))
2087 xsignal1 (Qinvalid_function, original_fun); 2087 xsignal1 (Qinvalid_function, original_fun);
@@ -2155,10 +2155,10 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2155 numargs += nargs - 2; 2155 numargs += nargs - 2;
2156 2156
2157 /* Optimize for no indirection. */ 2157 /* Optimize for no indirection. */
2158 if (SYMBOLP (fun) && !EQ (fun, Qunbound) 2158 if (SYMBOLP (fun) && !NILP (fun)
2159 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2159 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2160 fun = indirect_function (fun); 2160 fun = indirect_function (fun);
2161 if (EQ (fun, Qunbound)) 2161 if (NILP (fun))
2162 { 2162 {
2163 /* Let funcall get the error. */ 2163 /* Let funcall get the error. */
2164 fun = args[0]; 2164 fun = args[0];
@@ -2632,7 +2632,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2632 2632
2633 /* Optimize for no indirection. */ 2633 /* Optimize for no indirection. */
2634 fun = original_fun; 2634 fun = original_fun;
2635 if (SYMBOLP (fun) && !EQ (fun, Qunbound) 2635 if (SYMBOLP (fun) && !NILP (fun)
2636 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2636 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2637 fun = indirect_function (fun); 2637 fun = indirect_function (fun);
2638 2638
@@ -2720,7 +2720,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2720 val = funcall_lambda (fun, numargs, args + 1); 2720 val = funcall_lambda (fun, numargs, args + 1);
2721 else 2721 else
2722 { 2722 {
2723 if (EQ (fun, Qunbound)) 2723 if (NILP (fun))
2724 xsignal1 (Qvoid_function, original_fun); 2724 xsignal1 (Qvoid_function, original_fun);
2725 if (!CONSP (fun)) 2725 if (!CONSP (fun))
2726 xsignal1 (Qinvalid_function, original_fun); 2726 xsignal1 (Qinvalid_function, original_fun);