How does SRFI 250 hash-table-unfold handle repeated keys?
Sudarshan S Chawathe 24 Dec 2024 01:38 UTC
I cannot figure out from the description of hash-table-unfold what is to
be done if the mapper procedure returns the equal (by the comparator)
keys with different values during the unfolding process. Is the older
or newer association retained? For instance, what should the following
give?
(hash-table-fold cons*
'()
(hash-table-unfold (lambda (i) (>= i 5))
(lambda (i) (values (modulo i 2) (+ 100 i)))
(lambda (i) (+ i 1))
0
(make-default-comparator)))
(Just above the description of hash-table-fold, the analogous situation
in the procedure hash-table is specified as an error; just below, in the
description of alist->hash-table, earlier associations are retained.)
Regards,
-chaw