diff src/fns.c @ 25590:b01b1c94f6ee

(Fmakehash): Take one argument, test, make all the rest keyword arguments.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 07 Sep 1999 14:48:55 +0000
parents f6a59e53dac6
children e1f5592218c1
line wrap: on
line diff
--- a/src/fns.c	Tue Sep 07 14:48:54 1999 +0000
+++ b/src/fns.c	Tue Sep 07 14:48:55 1999 +0000
@@ -4315,16 +4315,12 @@
 the table.  Predefined tests are `eq', `eql', and `equal'.  Default\n\
 is `eql'.  New tests can be defined with `define-hash-table-test'.\n\
 \n\
-Optional second argument SIZE is a hint to the implementation as\n\
-to how many elements will be put in the table.  Default is 65.\n\
-\n\
-Optional third argument WEAKNESS must be one of nil, t, `key',\n\
- or `value'.  Default is nil.  Elements of weak hash tables\n\
-are removed when their key, value or both are otherwise unreferenced.\n\
-\n\
 The rest of the optional arguments are keyword/value pairs.  The\n\
 following are recognized:\n\
 \n\
+:SIZE SIZE -- A hint as to how many elements will be put in the table.
+Default is 65.\n\
+\n\
 :REHASH-SIZE REHASH-SIZE - Indicates how to expand the table when\n\
 it fills up.  If REHASH-SIZE is an integer, add that many space.\n\
 If it is a float, it must be > 1.0, and the new size is computed by\n\
@@ -4332,7 +4328,12 @@
 \n\
 :REHASH-THRESHOLD THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0.\n\
 Resize the hash table when ratio of the number of entries in the table.\n\
-Default is 0.8.")
+Default is 0.8.\n\
+\n\
+:WEAKNESS WEAK -- WEAK must be one of nil, t, `key', or `value'.\n\
+If WEAK is not nil, the table returned is a weak table.  Key/value\n\
+pairs are removed from a weak hash table when their key, value or both\n\
+(WEAK t) are otherwise unreferenced.  Default is nil.")
   (nargs, args)
      int nargs;
      Lisp_Object *args;
@@ -4346,29 +4347,13 @@
   if (SYMBOLP (args[i])
       && !EQ (args[i], QCrehash_size)
       && !EQ (args[i], QCrehash_threshold)
-      && !EQ (args[i], QCweakness))
+      && !EQ (args[i], QCweakness)
+      && !EQ (args[i], QCsize))
     {
       args2[j++] = QCtest;
       args2[j++] = args[i++];
     }
 
-  /* Recognize SIZE argument.  */
-  if (INTEGERP (args[i]))
-    {
-      args2[j++] = QCsize;
-      args2[j++] = args[i++];
-    }
-
-  /* Recognize WEAKNESS argument.  */
-  if (EQ (args[i], Qt)
-      || NILP (args[i])
-      || EQ (args[i], Qkey)
-      || EQ (args[i], Qvalue))
-    {
-      args2[j++] = QCweakness;
-      args2[j++] = args[i++];
-    }
-
   /* Copy remaining arguments.  */
   while (i < nargs)
     args2[j++] = args[i++];