Changes between Version 2 and Version 9 of Ticket #905


Ignore:
Timestamp:
08/27/12 03:57:36 (10 years ago)
Author:
Ivan Raikov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #905

    • Property Owner set to sjamaan
    • Property Status changed from new to assigned
    • Property Summary changed from Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4) to Unreliable 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 have been performed.
     1The 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.
    22The following code reproduces the issue:
    33
    44{{{
    5 
    6 (use srfi-1 srfi-69)
     5(import scheme chicken)
     6(require-extension srfi-69 srfi-1)
    77
    88(define t (make-hash-table hash: symbol-hash))
    99
    1010(hash-table-set! t 'k1 1)
    11 (hash-table-ref t 'k1)
    1211
     12(define prefix (gensym "test"))
     13       
     14 
    1315(for-each
    14   (lambda (k v)
    15     (printf "hash-table-set! ~A ~A~%" k v)
    16     (hash-table-set! t k v))
    17   (list-tabulate 10 (lambda (i) (gensym 'k)))
    18   (list-tabulate 10 (lambda (i) i))
    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 )
    2022
    2123(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
    2336}}}
    2437