Example fixes and a few comments Wolfgang Corcoran-Mathe (22 Jul 2021 18:50 UTC)
Re: Example fixes and a few comments John Cowan (22 Jul 2021 23:14 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (23 Jul 2021 14:30 UTC)
Re: Example fixes and a few comments John Cowan (23 Jul 2021 22:39 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (24 Jul 2021 06:32 UTC)
Re: Example fixes and a few comments Wolfgang Corcoran-Mathe (25 Jul 2021 19:59 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (25 Jul 2021 20:31 UTC)
Re: Example fixes and a few comments John Cowan (25 Jul 2021 21:54 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (26 Jul 2021 06:35 UTC)
Re: Example fixes and a few comments John Cowan (26 Jul 2021 22:18 UTC)
Re: Example fixes and a few comments Dr. Arne Babenhauserheide (27 Jul 2021 05:32 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (27 Jul 2021 05:38 UTC)
Re: Example fixes and a few comments John Cowan (06 Aug 2021 01:49 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (13 Aug 2021 10:25 UTC)
Re: Example fixes and a few comments John Cowan (21 Oct 2021 23:10 UTC)
Re: Example fixes and a few comments John Cowan (25 Jul 2021 21:46 UTC)
Re: Example fixes and a few comments Marc Nieper-Wißkirchen (26 Jul 2021 06:40 UTC)
fashes: fully functional hash tables Dr. Arne Babenhauserheide (25 Jul 2021 22:51 UTC)
Re: fashes: fully functional hash tables John Cowan (26 Jul 2021 00:38 UTC)

Example fixes and a few comments Wolfgang Corcoran-Mathe 22 Jul 2021 18:50 UTC
Hi John and Arvydas,

Thanks for all of your work on this SRFI.  I noticed a few typos in
the examples and have attached a patch.

On the topic of examples:

1. The comment in the example for dict-adjoin! ("new values are
prepended") is confusing.  This seems to be an implementation detail
for an alist version of dict-adjoin!, and has no clear meaning for
dict-adjoin! in general.

2. The example for dict-size seems to be wrong, assuming 'dict'
denotes the same value it does in earlier examples.  In this and in
later examples, I'd prefer fresh dictionary example values when
possible (SRFI documents with global state can be hard to read).

3. The examples for dict-fold and dict-map->list strike me as odd.
I had to think about

    (dict-map->list - dict) => (-1 -1 -1)

for a moment before it made sense.  I think a less subtle example
would make these forms easier to grasp.

Additional, preliminary, non-example-related points:

4. John has said that tail-calls by dict- procedures can't be
guaranteed, yet dict-search! is specified to tail-call its arguments.

5. Is the set of six procedures required by register-dictionary! to
define a new dictionary type minimal?  It seems cumbersome to require
foo-map!, foo-filter!, and foo-for-each.  At least for non-mutative
structures, all three can likely be implemented with foo-fold.  More
generally, I believe it's a mistake to include anything with a ! here.
If there is a reason for presence of these procedures (and not others)
in register-dictionary-type!, it should be made very clear whether or
not they are expected to have side-effects.  At the moment, it's not
clear to me whether this SRFI's interface works correctly and equally
well for both functional and mutative structures; the absence of
dict-map, in particular, suggests that this design may have been
railroaded by imperative interfaces.  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.

Best regards,

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>

"In a bureaucracy, the file cards are reality. Punching
new holes recreates the world." --Alan Moore, _V For Vendetta_