Implement new primitive `string-hash-mod' to enable efficient
authorChris Hanson <org/chris-hanson/cph>
Fri, 15 May 1987 18:20:45 +0000 (18:20 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 15 May 1987 18:20:45 +0000 (18:20 +0000)
string/symbol hashed tables to be implemented in Scheme.

v7/src/microcode/intern.c
v7/src/microcode/utabmd.scm
v7/src/microcode/version.h
v8/src/microcode/utabmd.scm
v8/src/microcode/version.h

index 639d44850c7541b34f03e33da1e5685f25085aa2..130881a6b9e72568c6f1292bcf23c21d261613c4 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/intern.c,v 9.40 1987/05/11 17:52:27 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/intern.c,v 9.41 1987/05/15 18:19:45 cph Rel $
 
    Utilities for manipulating symbols. 
  */
@@ -241,7 +241,7 @@ Built_In_Primitive(Prim_Intern_Character_List, 1,
 
   return string_to_symbol(list_to_string(Arg1));
 }
-\f
+
 /* (STRING-HASH STRING)
    Return a hash value for a string.  This uses the hashing
    algorithm used for interning symbols.  It is intended for use by
@@ -255,6 +255,16 @@ Built_In_Primitive(Prim_String_Hash, 1, "STRING-HASH", 0x83)
   return Hash(Arg1);
 }
 
+Built_In_Primitive (Prim_string_hash_mod, 2, "STRING-HASH-MOD", 0x8A)
+{
+  Primitive_2_Args ();
+  CHECK_ARG (1, STRING_P);
+
+  return
+    (MAKE_UNSIGNED_FIXNUM
+     ((scheme_string_hash (Arg1)) % (arg_nonnegative_integer (2))));
+}
+\f
 /* (CHARACTER-LIST-HASH LIST)
    Takes a list of ASCII codes for characters and returns a hash
    code for them.  This uses the hashing function used to intern
index 476321fca8ee03dd6d65f4cc51d3e18cef31606c..93c1f961b53491e64a47707fa76ca4f4e20dab0b 100644 (file)
@@ -37,7 +37,7 @@
 
 ;;;; Machine Dependent Type Tables
 
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.27 1987/04/29 13:19:32 cph Exp $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.28 1987/05/15 18:20:45 cph Exp $
 
 (declare (usual-integrations))
 
               SYSTEM-PAIR-CDR                          ;$87
               SYSTEM-PAIR-SET-CAR!                     ;$88
               SYSTEM-PAIR-SET-CDR!                     ;$89
-              #F                                       ;$8A
+              STRING-HASH-MOD                          ;$8A
               #F                                       ;$8B
               SET-CELL-CONTENTS!                       ;$8C
               &MAKE-OBJECT                             ;$8D
 
 ;;; This identification string is saved by the system.
 
-"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.27 1987/04/29 13:19:32 cph Exp $"
+"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.28 1987/05/15 18:20:45 cph Exp $"
index d3291b892ce80e1806cb97dd834c61e29ac8d537..a8e1efbe3aefc14f06f2c12215c962291e73dc85 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.51 1987/05/14 13:51:20 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.52 1987/05/15 18:20:28 cph Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     51
+#define SUBVERSION     52
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 880a4b639c60daa7d1f0c21d2fcd6d8f75145fbb..00797b7b90492751d3f2e3882c8265dc7233015d 100644 (file)
@@ -37,7 +37,7 @@
 
 ;;;; Machine Dependent Type Tables
 
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.27 1987/04/29 13:19:32 cph Exp $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.28 1987/05/15 18:20:45 cph Exp $
 
 (declare (usual-integrations))
 
               SYSTEM-PAIR-CDR                          ;$87
               SYSTEM-PAIR-SET-CAR!                     ;$88
               SYSTEM-PAIR-SET-CDR!                     ;$89
-              #F                                       ;$8A
+              STRING-HASH-MOD                          ;$8A
               #F                                       ;$8B
               SET-CELL-CONTENTS!                       ;$8C
               &MAKE-OBJECT                             ;$8D
 
 ;;; This identification string is saved by the system.
 
-"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.27 1987/04/29 13:19:32 cph Exp $"
+"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.28 1987/05/15 18:20:45 cph Exp $"
index dccb9fb0c86ccadd7202645703cd527298eec2d5..492a5e800d795258c83c77a837427053a84c8285 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.51 1987/05/14 13:51:20 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.52 1987/05/15 18:20:28 cph Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     51
+#define SUBVERSION     52
 #endif
 
 #ifndef UCODE_TABLES_FILENAME