[SQUASH] symbol
authorBT Templeton <bt@hcoop.net>
Sat, 17 Aug 2013 04:01:50 +0000 (00:01 -0400)
committerRobin Templeton <robin@terpri.org>
Sun, 19 Apr 2015 07:43:02 +0000 (03:43 -0400)
* 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'.

src/alloc.c
src/data.c
src/lisp.h
src/lread.c

index 65e063b..3fe4601 100644 (file)
@@ -1177,7 +1177,6 @@ initialize_symbol (Lisp_Object val, Lisp_Object name)
   p->redirect = SYMBOL_PLAINVAL;
   SET_SYMBOL_VAL (p, Qunbound);
   scm_module_define (function_module, val, Qnil);
   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;
 }
   p->constant = 0;
   p->declared_special = false;
 }
index 9f0b9a3..225ac10 100644 (file)
@@ -347,6 +347,15 @@ DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0,
   return Qnil;
 }
 
   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,
 /* Define this in C to avoid unnecessarily consing up the symbol
    name.  */
 DEFUN ("keywordp", Fkeywordp, Skeywordp, 1, 1, 0,
index 62e72ec..86d20ce 100644 (file)
@@ -1284,15 +1284,6 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct)
                               Symbols
  ***********************************************************************/
 
                               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,
 enum symbol_redirect
 {
   SYMBOL_PLAINVAL  = 4,
@@ -1317,10 +1308,6 @@ struct Lisp_Symbol
      can be changed, but only by `defconst'.  */
   unsigned constant : 2;
 
      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;
   /* True means that this variable has been explicitly declared
      special (with `defvar' etc), and shouldn't be lexically bound.  */
   bool_bf declared_special : 1;
@@ -1394,15 +1381,7 @@ SYMBOL_NAME (Lisp_Object sym)
 INLINE bool
 SYMBOL_INTERNED_P (Lisp_Object sym)
 {
 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
 }
 
 INLINE Lisp_Object
index 71ba679..54542fe 100644 (file)
@@ -3838,11 +3838,6 @@ it defaults to the value of `obarray'.  */)
                     obhash (obarray));
   initialize_symbol (sym, string);
 
                     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))
     {
   if ((SREF (string, 0) == ':')
       && EQ (obarray, initial_obarray))
     {
@@ -3931,7 +3926,6 @@ usage: (unintern NAME OBARRAY)  */)
       
     }
 
       
     }
 
-  //XSYMBOL (tem)->interned = SYMBOL_UNINTERNED;
   return (scm_is_true (scm_unintern (name, obhash (obarray))) ? Qt : Qnil);
 }
 \f
   return (scm_is_true (scm_unintern (name, obhash (obarray))) ? Qt : Qnil);
 }
 \f