While implementing SRFI-125 procedures for Guile, I stumbled across a few incompatibilities between the reference implementation and the SRFI-125 specification.
- Spec says hash-table returns an immutable hash table (if that is supported) and signal an error if there are duplicate keys, but standard implementation returns a mutable hash table and signals no error with duplicate keys
- Spec says hash-table-set! must go left to right, but in standard implementation it goes right to left
- Spec says hash-table-empty-copy returns a mutable hash table, but in standard implementation it returns an immutable hash table if the given hash table is immutable
Plus, hash-table-delete! seems to loop infinitely once it finds a key.
The attached patch is an attempt to fix them.