changeset 46221:2f81e2382d8d

(Fnconc): Use XCDR. (Fprovide): Use CONSP and XCDR. (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) (HASH_TABLE_SIZE): Delete: moved to lisp.h. (Fmake_hash_table): Accept `:size nil'. (Fmakehash): Delete: moved to subr.el. (syms_of_fns): Don't defsubr makehash.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 07 Jul 2002 20:57:25 +0000
parents 5abad41fb43b
children abba3d3c7e98
files src/fns.c
diffstat 1 files changed, 7 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Sun Jul 07 20:52:08 2002 +0000
+++ b/src/fns.c	Sun Jul 07 20:57:25 2002 +0000
@@ -2742,7 +2742,7 @@
       while (CONSP (tem))
 	{
 	  tail = tem;
-	  tem = Fcdr (tail);
+	  tem = XCDR (tail);
 	  QUIT;
 	}
 
@@ -3206,8 +3206,8 @@
 
   /* Run any load-hooks for this file.  */
   tem = Fassq (feature, Vafter_load_alist);
-  if (!NILP (tem))
-    Fprogn (Fcdr (tem));
+  if (CONSP (tem))
+    Fprogn (XCDR (tem));
 
   return feature;
 }
@@ -3896,32 +3896,6 @@
    if a `:linear-search t' argument is given to make-hash-table.  */
 
 
-/* Value is the key part of entry IDX in hash table H.  */
-
-#define HASH_KEY(H, IDX)   AREF ((H)->key_and_value, 2 * (IDX))
-
-/* Value is the value part of entry IDX in hash table H.  */
-
-#define HASH_VALUE(H, IDX) AREF ((H)->key_and_value, 2 * (IDX) + 1)
-
-/* Value is the index of the next entry following the one at IDX
-   in hash table H.  */
-
-#define HASH_NEXT(H, IDX)  AREF ((H)->next, (IDX))
-
-/* Value is the hash code computed for entry IDX in hash table H.  */
-
-#define HASH_HASH(H, IDX)  AREF ((H)->hash, (IDX))
-
-/* Value is the index of the element in hash table H that is the
-   start of the collision list at index IDX in the index vector of H.  */
-
-#define HASH_INDEX(H, IDX)  AREF ((H)->index, (IDX))
-
-/* Value is the size of hash table H.  */
-
-#define HASH_TABLE_SIZE(H) XVECTOR ((H)->next)->size
-
 /* The list of all weak hash tables.  Don't staticpro this one.  */
 
 Lisp_Object Vweak_hash_tables;
@@ -4929,8 +4903,10 @@
 
   /* See if there's a `:size SIZE' argument.  */
   i = get_key_arg (QCsize, nargs, args, used);
-  size = i < 0 ? make_number (DEFAULT_HASH_SIZE) : args[i];
-  if (!INTEGERP (size) || XINT (size) < 0)
+  size = i < 0 ? Qnil : args[i];
+  if (NILP (size))
+    size = make_number (DEFAULT_HASH_SIZE);
+  else if (!INTEGERP (size) || XINT (size) < 0)
     Fsignal (Qerror,
 	     list2 (build_string ("Invalid hash table size"),
 		    size));
@@ -4988,22 +4964,6 @@
 }
 
 
-DEFUN ("makehash", Fmakehash, Smakehash, 0, 1, 0,
-       doc: /* Create a new hash table.
-	  
-Optional first argument TEST specifies how to compare keys in the
-table.  Predefined tests are `eq', `eql', and `equal'.  Default is
-`eql'.  New tests can be defined with `define-hash-table-test'.  */)
-     (test)
-     Lisp_Object test;
-{
-  Lisp_Object args[2];
-  args[0] = QCtest;
-  args[1] = NILP (test) ? Qeql : test;
-  return Fmake_hash_table (2, args);
-}
-
-
 DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0,
        doc: /* Return the number of elements in TABLE.  */)
      (table)
@@ -5427,7 +5387,6 @@
   defsubr (&Ssxhash);
   defsubr (&Smake_hash_table);
   defsubr (&Scopy_hash_table);
-  defsubr (&Smakehash);
   defsubr (&Shash_table_count);
   defsubr (&Shash_table_rehash_size);
   defsubr (&Shash_table_rehash_threshold);