Gregory Marton <address@hidden> writes:
I may be misunderstanding something, but I thought this should yield 'bar:
guile> (let ((ht (make-hash-table)))
(hashx-set! (lambda (k s) 1) equal? ht 'foo 'bar)
(hashx-ref (lambda (k s) 1) equal? ht 'foo))
#f
The second arg to hashx-set! and hashx-ref is supposed to be like
assoc/assq/assv, not equal?/eqv?/eq?. So...
guile> (let ((ht (make-hash-table)))
(hashx-set! (lambda (k s) 1) assoc ht 'foo 'bar)
(hashx-ref (lambda (k s) 1) assoc ht 'foo))
bar
I thought perhaps the problem was with the equality test somehow, but
then even worse:
guile> (let ((ht (make-hash-table)))
(hashx-set! (lambda (k s) 1) (lambda (a b) #t) ht 'foo 'bar)
(hashx-ref (lambda (k s) 1) (lambda (a b) #t) ht 'foo))
Bus error
That definitely shouldn't happen, though. Would you mind raising this
as a bug at Guile's Savannah project, for ease of tracking, and attach
the test patch that reproduces it (for which many thanks!).
Regards,
Neil