This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

rnrs hashtables bug fixes


As of r6878, these (rnrs hashtables) functions aren't working: hashtable-copy, hashtable-equivalence-function, and hashtable- mutable?. The attached patch (which modifies kawa/lib/kawa/ hashtable.scm and kawa/lib/rnrs/hashtables.scm) seems to fix them.

Index: kawa/lib/kawa/hashtable.scm
===================================================================
--- kawa/lib/kawa/hashtable.scm	(revision 6878)
+++ kawa/lib/kawa/hashtable.scm	(working copy)
@@ -31,12 +31,12 @@
    (set! equivalenceFunction eq)
    (set! hashFunction h))
   ((*init* (ht :: hashtable) (mutable :: boolean))
-    (invoke-special hashtable (this)
-		    (ht:equivalenceFunction)
-		    (ht:hashFunction)
-		    (+ (ht:size) 100))
+    (invoke-special hashtable (this) '*init*
+                    ht:equivalenceFunction
+                    ht:hashFunction
+                    (if mutable (+ (ht:size) 100) (ht:size)))
     (putAll ht)
-    (set! this:mutable mutable))
+    (set! (this):mutable mutable))
   ((hash key) :: int
    (hashFunction key))
   ((matches value1 value2) :: <boolean>
Index: kawa/lib/rnrs/hashtables.scm
===================================================================
--- kawa/lib/rnrs/hashtables.scm	(revision 6878)
+++ kawa/lib/rnrs/hashtables.scm	(working copy)
@@ -85,7 +85,7 @@
     (values (car pair) (cdr pair))))

(define (hashtable-equivalence-function (ht :: hashtable)) :: procedure
- (ht:equivalenceFunction ht))
+ ht:equivalenceFunction)


 (define (hashtable-hash-function  (ht :: hashtable))
   (let ((hasher (ht:hashFunction ht)))
@@ -94,8 +94,8 @@
 	#f
 	hasher)))

-(define (hashtable-mutable? (ht :: hashtable)) :: bbolean
-  (ht:mutable))
+(define (hashtable-mutable? (ht :: hashtable)) :: boolean
+  ht:mutable)

 ;; FIXME is supposed to always terminate, but that is not guaranteed.
 (define (equal-hash key)


-Jamie


--
Jamison Hope
The PTR Group
www.theptrgroup.com


Attachment: hashtable.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]