summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/eval.c b/src/eval.c
index 52e4c96d4b2..40b47968be2 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -603,7 +603,7 @@ The return value is BASE-VARIABLE. */)
sym = XSYMBOL (new_alias);
- switch (sym->redirect)
+ switch (sym->u.s.redirect)
{
case SYMBOL_FORWARDED:
error ("Cannot make an internal variable an alias");
@@ -632,14 +632,14 @@ The return value is BASE-VARIABLE. */)
error ("Don't know how to make a let-bound variable an alias");
}
- if (sym->trapped_write == SYMBOL_TRAPPED_WRITE)
+ if (sym->u.s.trapped_write == SYMBOL_TRAPPED_WRITE)
notify_variable_watchers (new_alias, base_variable, Qdefvaralias, Qnil);
- sym->declared_special = 1;
- XSYMBOL (base_variable)->declared_special = 1;
- sym->redirect = SYMBOL_VARALIAS;
+ sym->u.s.declared_special = true;
+ XSYMBOL (base_variable)->u.s.declared_special = true;
+ sym->u.s.redirect = SYMBOL_VARALIAS;
SET_SYMBOL_ALIAS (sym, XSYMBOL (base_variable));
- sym->trapped_write = XSYMBOL (base_variable)->trapped_write;
+ sym->u.s.trapped_write = XSYMBOL (base_variable)->u.s.trapped_write;
LOADHIST_ATTACH (new_alias);
/* Even if docstring is nil: remove old docstring. */
Fput (new_alias, Qvariable_documentation, docstring);
@@ -745,7 +745,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
tem = Fdefault_boundp (sym);
/* Do it before evaluating the initial value, for self-references. */
- XSYMBOL (sym)->declared_special = 1;
+ XSYMBOL (sym)->u.s.declared_special = true;
if (NILP (tem))
Fset_default (sym, eval_sub (XCAR (tail)));
@@ -769,7 +769,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
LOADHIST_ATTACH (sym);
}
else if (!NILP (Vinternal_interpreter_environment)
- && !XSYMBOL (sym)->declared_special)
+ && !XSYMBOL (sym)->u.s.declared_special)
/* A simple (defvar foo) with lexical scoping does "nothing" except
declare that var to be dynamically scoped *locally* (i.e. within
the current file or let-block). */
@@ -818,7 +818,7 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
if (!NILP (Vpurify_flag))
tem = Fpurecopy (tem);
Fset_default (sym, tem);
- XSYMBOL (sym)->declared_special = 1;
+ XSYMBOL (sym)->u.s.declared_special = true;
if (!NILP (docstring))
{
if (!NILP (Vpurify_flag))
@@ -837,7 +837,7 @@ DEFUN ("internal-make-var-non-special", Fmake_var_non_special,
(Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- XSYMBOL (symbol)->declared_special = 0;
+ XSYMBOL (symbol)->u.s.declared_special = false;
return Qnil;
}
@@ -877,7 +877,7 @@ usage: (let* VARLIST BODY...) */)
}
if (!NILP (lexenv) && SYMBOLP (var)
- && !XSYMBOL (var)->declared_special
+ && !XSYMBOL (var)->u.s.declared_special
&& NILP (Fmemq (var, Vinternal_interpreter_environment)))
/* Lexically bind VAR by adding it to the interpreter's binding
alist. */
@@ -953,7 +953,7 @@ usage: (let VARLIST BODY...) */)
tem = temps[argnum];
if (!NILP (lexenv) && SYMBOLP (var)
- && !XSYMBOL (var)->declared_special
+ && !XSYMBOL (var)->u.s.declared_special
&& NILP (Fmemq (var, Vinternal_interpreter_environment)))
/* Lexically bind VAR by adding it to the lexenv alist. */
lexenv = Fcons (Fcons (var, tem), lexenv);
@@ -1022,7 +1022,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
tem = Fassq (sym, environment);
if (NILP (tem))
{
- def = XSYMBOL (sym)->function;
+ def = XSYMBOL (sym)->u.s.function;
if (!NILP (def))
continue;
}
@@ -1932,8 +1932,8 @@ this does nothing and returns nil. */)
CHECK_STRING (file);
/* If function is defined and not as an autoload, don't override. */
- if (!NILP (XSYMBOL (function)->function)
- && !AUTOLOADP (XSYMBOL (function)->function))
+ if (!NILP (XSYMBOL (function)->u.s.function)
+ && !AUTOLOADP (XSYMBOL (function)->u.s.function))
return Qnil;
if (!NILP (Vpurify_flag) && EQ (docstring, make_number (0)))
@@ -2164,7 +2164,7 @@ eval_sub (Lisp_Object form)
fun = original_fun;
if (!SYMBOLP (fun))
fun = Ffunction (Fcons (fun, Qnil));
- else if (!NILP (fun) && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
+ else if (!NILP (fun) && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
fun = indirect_function (fun);
if (SUBRP (fun))
@@ -2347,7 +2347,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
/* Optimize for no indirection. */
if (SYMBOLP (fun) && !NILP (fun)
- && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
+ && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
{
fun = indirect_function (fun);
if (NILP (fun))
@@ -2759,7 +2759,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
/* Optimize for no indirection. */
fun = original_fun;
if (SYMBOLP (fun) && !NILP (fun)
- && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
+ && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
fun = indirect_function (fun);
if (SUBRP (fun))
@@ -3075,7 +3075,7 @@ function with `&rest' args, or `unevalled' for a special form. */)
function = original;
if (SYMBOLP (function) && !NILP (function))
{
- function = XSYMBOL (function)->function;
+ function = XSYMBOL (function)->u.s.function;
if (SYMBOLP (function))
function = indirect_function (function);
}
@@ -3214,7 +3214,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
if ((--p)->kind > SPECPDL_LET)
{
struct Lisp_Symbol *let_bound_symbol = XSYMBOL (specpdl_symbol (p));
- eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
+ eassert (let_bound_symbol->u.s.redirect != SYMBOL_VARALIAS);
if (symbol == let_bound_symbol
&& EQ (specpdl_where (p), buf))
return 1;
@@ -3227,10 +3227,10 @@ static void
do_specbind (struct Lisp_Symbol *sym, union specbinding *bind,
Lisp_Object value, enum Set_Internal_Bind bindflag)
{
- switch (sym->redirect)
+ switch (sym->u.s.redirect)
{
case SYMBOL_PLAINVAL:
- if (!sym->trapped_write)
+ if (!sym->u.s.trapped_write)
SET_SYMBOL_VAL (sym, value);
else
set_internal (specpdl_symbol (bind), value, Qnil, bindflag);
@@ -3274,7 +3274,7 @@ specbind (Lisp_Object symbol, Lisp_Object value)
sym = XSYMBOL (symbol);
start:
- switch (sym->redirect)
+ switch (sym->u.s.redirect)
{
case SYMBOL_VARALIAS:
sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start;
@@ -3298,10 +3298,10 @@ specbind (Lisp_Object symbol, Lisp_Object value)
specpdl_ptr->let.where = Fcurrent_buffer ();
specpdl_ptr->let.saved_value = Qnil;
- eassert (sym->redirect != SYMBOL_LOCALIZED
+ eassert (sym->u.s.redirect != SYMBOL_LOCALIZED
|| (EQ (SYMBOL_BLV (sym)->where, Fcurrent_buffer ())));
- if (sym->redirect == SYMBOL_LOCALIZED)
+ if (sym->u.s.redirect == SYMBOL_LOCALIZED)
{
if (!blv_found (SYMBOL_BLV (sym)))
specpdl_ptr->let.kind = SPECPDL_LET_DEFAULT;
@@ -3412,9 +3412,9 @@ do_one_unbind (union specbinding *this_binding, bool unwinding,
{ /* If variable has a trivial value (no forwarding), and isn't
trapped, we can just set it. */
Lisp_Object sym = specpdl_symbol (this_binding);
- if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL)
+ if (SYMBOLP (sym) && XSYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL)
{
- if (XSYMBOL (sym)->trapped_write == SYMBOL_UNTRAPPED_WRITE)
+ if (XSYMBOL (sym)->u.s.trapped_write == SYMBOL_UNTRAPPED_WRITE)
SET_SYMBOL_VAL (XSYMBOL (sym), specpdl_old_value (this_binding));
else
set_internal (sym, specpdl_old_value (this_binding),
@@ -3546,7 +3546,7 @@ context where binding is lexical by default. */)
(Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- return XSYMBOL (symbol)->declared_special ? Qt : Qnil;
+ return XSYMBOL (symbol)->u.s.declared_special ? Qt : Qnil;
}
@@ -3702,7 +3702,8 @@ backtrace_eval_unrewind (int distance)
just set it. No need to check for constant symbols here,
since that was already done by specbind. */
Lisp_Object sym = specpdl_symbol (tmp);
- if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL)
+ if (SYMBOLP (sym)
+ && XSYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL)
{
Lisp_Object old_value = specpdl_old_value (tmp);
set_specpdl_old_value (tmp, SYMBOL_VAL (XSYMBOL (sym)));