pfds icon indicating copy to clipboard operation
pfds copied to clipboard

HAMTs exhibit strange behavior when inserting tenths of values

Open tbrezot opened this issue 1 year ago • 0 comments

I just installed this library using Guix (guile-pfds v.0.3), but I encounter behaviors I cannot explain:

(use-modules (srfi srfi-1))
(use-modules (pfds hamts))
(define make-string-hamt (lambda () (make-hamt string-hash string=?)))
(define hamt (fold (lambda (i hamt) (hamt-set hamt (format #f "~d" i) i))
                   (make-string-hamt)
                   (iota 100)))
(hamt-size hamt)

returns 78. Stranger, even:

(define hamt (hamt-set hamt "1" 1))
(hamt-ref hamt "1" #f)

Returns #f.

My version of guile is the v3.0.9.

tbrezot avatar Dec 30 '24 14:12 tbrezot