Re: 4.0.0 problem with using symbols as hash table keys

From: Harvey J. Stein <>
Date: 13 Sep 1999 17:00:51 -0400

Erick Gallesio <> writes:

> Jonathan Berry writes:
> > 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:
> As replied Shiro, actual behavior is "better behavior, because the symbol
> returned by gensym is not interned so that it can't be eq? to
> the symbols with the same name." This is the Right Thing to do IMHO
> for the system gensym.

But that doesn't explain why his code doesn't work when equal? is used
as the hash table equality function:

   STk> (define h (make-hash-table equal?))
   STk> (define k (gensym "abc"))
   STk> k
   STk> (hash-table-put! h k 1)
   STk> (equal? k 'abc3)
   STk> (hash-table-get h k)
   STk> (hash-table-get h 'abc3)

   *** Error:
   hash-table-get: entry not defined for this key: abc3

Harvey Stein
Bloomberg LP
Received on Mon Sep 13 1999 - 23:03:55 CEST

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