(make-hash-table equal?) is broken (in 2.2)?

From: Michael A. Patton <MAP_at_BBN.COM>
Date: Fri, 13 Oct 1995 17:34:18 EDT

I have a need for a hash table with equal? as the comparison operator
(the keys are lists of symbols), but hash-table-get doesn't seem to
work (even if I try to lookup a key that is eq?). It seems to work OK
if the keys are a single symbol. Attached is a short transcript
showing the problem. I don't have a chance right now to delve into
the hash-table code, but if anyone has a hint (or a fix :-), I'd
appreciate it... I did verify that hash-table-hash does return the
same value for different, but equal? lists (although this isn't
evident below...)

        -MAP
----------------------------------------------------------------
gaak> snow
Welcome to the STk interpreter version 2.2 [SunOS-4.1.3_U1-sun4]
Copyright (C) 1993,1994,1995 Erick Gallesio - I3S - CNRS / ESSI <eg_at_unice.fr>
STk> (define foo (make-hash-table equal?))
#[undefined]
STk> (define l1 '(foo bar baz))
#[undefined]
STk> (hash-table-put! foo l1 'baz)
#[undefined]
STk> (hash-table-get foo l1)

*** Error:
    hash-table-get: entry not defined for this key: (foo bar baz)
Current eval stack:
__________________
  0 (hash-table-get foo l1)
STk> (hash-table-for-each foo (lambda (k v) (format #t "key:~S\nval:~S\n" k v)))
key:(foo bar baz)
val:baz
#[undefined]
STk> (hash-table-put! foo 'barf 'bletch)
#[undefined]
STk> (hash-table-get foo 'barf)
bletch
STk>
Received on Fri Oct 13 1995 - 22:40:30 CET

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