Changes between Version 2 and Version 9 of Ticket #905
 Timestamp:
 08/27/12 03:57:36 (11 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Ticket #905
 Property Owner set to sjamaan

Property
Status
changed from
new
toassigned

Property
Summary
changed from
Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4)
toUnreliable behavior of hashtablecopy with symbols as keys (regression wrt 4.7.4)

Ticket #905 – Description
v2 v9 1 The nemo program relies heavily on performing transformations over hash tables with symbols as keys. It works fine with Chicken 4.7.4, but unfortunately there seems to have been a regression in 4.8.0rc1, which results in hashtableexists? and hashtableref failing to find any of the existing keys in the table after a number of transformations havebeen performed.1 The nemo program relies heavily on performing transformations over hash tables with symbols as keys. It works fine with Chicken 4.7.4, but unfortunately there seems to have been a regression in 4.8.0rc1, which results in hashtableexists? and hashtableref failing to find any of the existing keys in the table after hashtablecopy has been performed. 2 2 The following code reproduces the issue: 3 3 4 4 {{{ 5 6 ( use srfi1 srfi69)5 (import scheme chicken) 6 (requireextension srfi69 srfi1) 7 7 8 8 (define t (makehashtable hash: symbolhash)) 9 9 10 10 (hashtableset! t 'k1 1) 11 (hashtableref t 'k1)12 11 12 (define prefix (gensym "test")) 13 14 13 15 (foreach 14 15 (printf "hashtableset! ~A ~A~%" k v)16 17 (listtabulate 10 (lambda (i) (gensym 'k)))18 19 16 (lambda (k v) 17 ;; (printf "hashtableset! ~A ~A~%" k v) 18 (hashtableset! t k v)) 19 (listtabulate 10 (lambda (i) (string>symbol (stringappend (symbol>string prefix) ":" (symbol>string (gensym "k")))))) 20 (listtabulate 10 (lambda (i) i)) 21 ) 20 22 21 23 (print (hashtable>alist t)) 22 (print (hashtableref t 'k15)) 24 ;; hashtableref works as expected 25 (print (hashtableref t 'k1)) 26 (print (hashtableref t 'test17:k29)) 27 28 (define t2 (hashtablecopy t)) 29 30 (print (hashtable>alist t2)) 31 32 ;; hashtableref fails 33 (print (hashtableref t2 'k1)) 34 (print (hashtableref t2 'test17:k29)) 35 23 36 }}} 24 37