Fixed bug in `make-hash-table' and `alist->hash-table': neither
authorArthur Gleckler <edu/mit/csail/zurich/arthur>
Wed, 2 Aug 2006 05:54:51 +0000 (05:54 +0000)
committerArthur Gleckler <edu/mit/csail/zurich/arthur>
Wed, 2 Aug 2006 05:54:51 +0000 (05:54 +0000)
provided defaults for `key=?' or `key-hash', so both created
nonfunctioning hash tables if called without both of those parameters.

v7/src/runtime/hashtb.scm

index e91cab78669b47b0a7058632f466aef8f35c97ac..8ac109741b355da76c0ba9979dc2417594da3668 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: hashtb.scm,v 1.34 2006/02/26 03:00:38 cph Exp $
+$Id: hashtb.scm,v 1.35 2006/08/02 05:54:51 savannah-arthur Exp $
 
 Copyright 1990,1991,1993,1994,1995,2003 Massachusetts Institute of Technology
 Copyright 2004,2005,2006 Massachusetts Institute of Technology
@@ -760,7 +760,14 @@ USA.
 ;;;; SRFI-69 compatability
 
 (define (make-hash-table #!optional key=? key-hash initial-size)
-  (%make-hash-table (custom-table-type key=? key-hash) initial-size))
+  (%make-hash-table (custom-table-type
+                    (if (default-object? key=?)
+                        equal?
+                        key=?)
+                    (if (default-object? key-hash)
+                        equal-hash-mod
+                        key-hash))
+                   initial-size))
 
 (define (custom-table-type key=? key-hash)
   (cond ((and (eq? key=? eq?)