hash-table-delete! and return value Peter Lane (20 May 2017 16:43 UTC)
Re: hash-table-delete! and return value John Cowan (20 May 2017 22:07 UTC)

hash-table-delete! and return value Peter Lane 20 May 2017 16:43 UTC

Looking at SRFI 125, the specification states that hash-table-delete!
returns the number of keys deleted which had associations:

----
  (hash-table-delete! hash-table key ...)

Deletes any association to each key in hash-table and ***returns the
number of keys that had associations***.
----

However, the reference implementation does not check or return this
information:

----
(define (hash-table-delete! ht . keys)
   (for-each (lambda (key)
               (hashtable-delete! ht key))
             keys))
----

Larceny scheme follows the reference implementation and does not return
a value, but Sagittarius scheme follows the specification and does
return the number of keys.

I can create a pull request for the reference implementation, to stay
consistent with the specification.

--
Peter Lane
http://peterlane.info/scheme.html