[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Strings in hash tables



Surprisingly, this displays "not found": 

(let ([h (make-hash-table)]) 
  (hash-table-put! h "some-key" #t) 
  (if (hash-table-get h "some-key" (lambda () #f) ) 
    (display "found") 
    (display "not found"))) 

That's because MzScheme hash tables use `eq?' for hashing, by default.
In the 199.x versions, you can use the 'equal flag to change the
behavior to suit your taste.

-- Paul