fashes: fully functional hash tables Dr. Arne Babenhauserheide 25 Jul 2021 22:51 UTC
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz> writes:

> On 2021-07-22 19:14 -0400, John Cowan wrote:
>> >  I'd like to read more before
>> > developing this point, but I believe it's crucial that dictionaries
>> > either support both approaches or be divided into two classes.
>> >
>>
>> "Facts are stubborn things."  Some dictionaries (that already exist)
>> support mutation only, some (again, that already exist) don't support
>> mutation but do support functional update, some in the future may be
>> completely immutable (perfect hash tables, anyone?).

Did you see the fashes for Guile?

https://hg.sr.ht/~bjoli/guile-fash/browse/fash.scm?rev=tip

;;; A fash is a functional hash map. The interface is similar to that of regular
;;; hash tables with eq? eqv? and equal? behaviour with regards to keys.
;;; When creating fashes you have to decide how keys are compared. If the keys you
;;; are using are comparable using eq? (like symbols or keywords) that is by far
;;; the fastest way of comparing keys. If you want to use strings as keys, you will
;;; have to use the (fash ...)-style fashes. For eqv? comparisons you can use (fashv ...)
;;; and for eq? comparisons (fashq ...).

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken