* src/lisp.h (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P): Move...
* src/data.c (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P): ...here, and
update for Guile.
* src/lisp.h (SYMBOL_INTERNED_P): Use `scm_symbol_interned_p'.
p->redirect = SYMBOL_PLAINVAL;
SET_SYMBOL_VAL (p, Qunbound);
scm_module_define (function_module, val, Qnil);
- p->interned = SYMBOL_UNINTERNED;
p->constant = 0;
p->declared_special = false;
}
return Qnil;
}
+static bool
+SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (Lisp_Object sym)
+{
+ /* Should be initial_obarray */
+ Lisp_Object tem = Ffind_symbol (SYMBOL_NAME (sym), Vobarray);
+ return (! NILP (scm_c_value_ref (tem, 1))
+ && (EQ (sym, scm_c_value_ref (tem, 0))));
+}
+
/* Define this in C to avoid unnecessarily consing up the symbol
name. */
DEFUN ("keywordp", Fkeywordp, Skeywordp, 1, 1, 0,
Symbols
***********************************************************************/
-/* Interned state of a symbol. */
-
-enum symbol_interned
-{
- SYMBOL_UNINTERNED = 0,
- SYMBOL_INTERNED = 1,
- SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2
-};
-
enum symbol_redirect
{
SYMBOL_PLAINVAL = 4,
can be changed, but only by `defconst'. */
unsigned constant : 2;
- /* Interned state of the symbol. This is an enumerator from
- enum symbol_interned. */
- unsigned interned : 2;
-
/* True means that this variable has been explicitly declared
special (with `defvar' etc), and shouldn't be lexically bound. */
bool_bf declared_special : 1;
INLINE bool
SYMBOL_INTERNED_P (Lisp_Object sym)
{
- return XSYMBOL (sym)->interned != SYMBOL_UNINTERNED;
-}
-
-/* Value is true if SYM is interned in initial_obarray. */
-
-INLINE bool
-SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (Lisp_Object sym)
-{
- return XSYMBOL (sym)->interned == SYMBOL_INTERNED_IN_INITIAL_OBARRAY;
+ return scm_is_true (scm_symbol_interned_p (sym));
}
INLINE Lisp_Object
obhash (obarray));
initialize_symbol (sym, string);
- if (EQ (obarray, initial_obarray))
- XSYMBOL (sym)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY;
- else
- XSYMBOL (sym)->interned = SYMBOL_INTERNED;
-
if ((SREF (string, 0) == ':')
&& EQ (obarray, initial_obarray))
{
}
- //XSYMBOL (tem)->interned = SYMBOL_UNINTERNED;
return (scm_is_true (scm_unintern (name, obhash (obarray))) ? Qt : Qnil);
}
\f