hash-table-get problem?

From: Sarah Officer <officers_at_nemesis.tucson.saic.com>
Date: Wed, 7 Jun 1995 15:46:43 -0700 (MST)

I am having difficulty retrieving a value from a hash table when the
key is a string. It looks like the key is in the table, and I can retrieve
it using hash-table-map or hash-table->list. Have I made a mistake?

STk> (define h (make-hash-table))
STk> (hash-table-put! h 'foo "bar")
STk> (hash-table-get h 'foo)
STk> (hash-table-put! h "sad" "story")
STk> (hash-table-get h "sad")

*** Error:
hash-table-get: entry not defined: "sad"
STk> (hash-table-map h (lambda (key val) (cons key val)))
(("sad" . "story") (foo . "bar"))
STk> (define ll (hash-table->list h))
STk> ll
(("sad" . "story") (foo . "bar"))
STk> (assoc "sad" ll)
("sad" . "story")

Sarah Officer
Received on Thu Jun 08 1995 - 00:43:05 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST