4.0.0 problem with using symbols as hash table keys
4.0.0 looks promising, but I can't use it yet. My application is defeated
by the following behavior: a variable whose value is a symbol generated
by gensym can be used to look up a hash value, but the symbol itself
cannot. This was not a problem in any of the previous versions of STk.
Here's an example:
-----------------------------------------------------------------------
STk> (define h (make-hash-table))
h
STk> (define s (gensym "graph-view"))
s
STk> (describe s)
graph-view75 is a symbol.
STk> (hash-table-put! h s 6)
STk> (hash-table-get h s)
6
STk> (hash-table-get h 'graph-view75) ; this used to work
*** Error:
hash-table-get: entry not defined for this key: graph-view75
STk> (equal? s 'graph-view75)
#t
STk> (define s2 's2)
s2
STk> (hash-table-put! h s2 7)
STk> (hash-table-get h s2)
7
STk> (hash-table-get h 's2) ;seems to work if symbol wasn't made by gensym
7
STk>
-Jon
Received on Sat Sep 11 1999 - 22:31:48 CEST
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST