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)

Re: Example fixes and a few comments Wolfgang Corcoran-Mathe 25 Jul 2021 19:59 UTC

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?).  So as I mentioned in
> an earlier post, ! here means "may mutate": you get back the possibly-new,
> possibly-old object and have to use it henceforth, which is the definition
> of linear-update.

A related question: How much inference of generic procedures can we
expect a SRFI 225 implementation to do?  The spec for
register-dictionary-type! mentions "the versions automatically
provided by the implementation"; does this mean that we can expect
any dict- procedure to work on arbitrary dictionaries?  If so, we
must be able to define all of the procedures of this SRFI in terms of
the argumnets to register-dictionary-type!; this is not currently
possible.  If not, what happens when you call an unimplemented
procedure?  (The sample implementation simply calls 'error'.)

I believe that we should be able to expect any dict- procedure to
work on any dictionary.  To do this, a minimal set of procedures
will have to be selected which can be used to implement the rest.
There is simply no way around providing primitive non-mutative
forms; there's no way to implement dict-map, e.g., in terms of
dict-map!.  The alternative is a library which is not truly generic;
any procedure can blow up if you call it on the wrong object, so
you'll have to know about the internals of the dictionaries you're
operating on.  That's an obvious abstraction leak.

Side note: The name of register-dictionary! should be updated to
register-dictionary-type! in the sample implementation.

Further to the side note: The examples for dict-map->list, etc.
look alright to me, now; I suppose I was not at my sharpest when I
first read them.  I might suggest the additional example

    (dict-map->list (lambda (k v) v) dict) => (2 4 6),

which is pretty direct, I think.

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

"Never do programs contain so few bugs as when no debugging tools
are available." --Niklaus Wirth