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))
#[undefined]
STk> (hash-table-put! h 'foo "bar")
#[undefined]
STk> (hash-table-get h 'foo)
"bar"
STk> (hash-table-put! h "sad" "story")
#[undefined]
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))
#[undefined]
STk> ll
(("sad" . "story") (foo . "bar"))
STk> (assoc "sad" ll)
("sad" . "story")
Sarah Officer
officers_at_aries.tucson.saic.com
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