Re: 4.0.0 problem with using symbols as hash table keys

From: Erick Gallesio <>
Date: Mon, 13 Sep 1999 22:42:12 +0200 (CEST)

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 perhaps you could write your own gensym
function. In fact gensym, prior 4.0, was

    (define gensym
      (let ((counter 0))
        (lambda prefix
          (set! counter (+ counter 1))
             (string-append (if (null? prefix) "G" (car prefix))
                            (number->string counter))))))

For 4.0, I have just replaced the string->symbol to the (new)
primitive string->uninterned-symbol

Hope it helps.

                -- Erick
Received on Mon Sep 13 1999 - 22:56:00 CEST

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