Changes between Version 2 and Version 9 of Ticket #905
- Timestamp:
- 08/27/12 03:57:36 (12 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 hash-table-copy 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 hash-table-exists? and hash-table-ref 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 hash-table-exists? and hash-table-ref failing to find any of the existing keys in the table after hash-table-copy has been performed. 2 2 The following code reproduces the issue: 3 3 4 4 {{{ 5 6 ( use srfi-1 srfi-69)5 (import scheme chicken) 6 (require-extension srfi-69 srfi-1) 7 7 8 8 (define t (make-hash-table hash: symbol-hash)) 9 9 10 10 (hash-table-set! t 'k1 1) 11 (hash-table-ref t 'k1)12 11 12 (define prefix (gensym "test")) 13 14 13 15 (for-each 14 15 (printf "hash-table-set! ~A ~A~%" k v)16 17 (list-tabulate 10 (lambda (i) (gensym 'k)))18 19 16 (lambda (k v) 17 ;; (printf "hash-table-set! ~A ~A~%" k v) 18 (hash-table-set! t k v)) 19 (list-tabulate 10 (lambda (i) (string->symbol (string-append (symbol->string prefix) ":" (symbol->string (gensym "k")))))) 20 (list-tabulate 10 (lambda (i) i)) 21 ) 20 22 21 23 (print (hash-table->alist t)) 22 (print (hash-table-ref t 'k15)) 24 ;; hash-table-ref works as expected 25 (print (hash-table-ref t 'k1)) 26 (print (hash-table-ref t 'test17:k29)) 27 28 (define t2 (hash-table-copy t)) 29 30 (print (hash-table->alist t2)) 31 32 ;; hash-table-ref fails 33 (print (hash-table-ref t2 'k1)) 34 (print (hash-table-ref t2 'test17:k29)) 35 23 36 }}} 24 37