Re: iset-search implementations
Wolfgang Corcoran-Mathe 31 Dec 2020 18:23 UTC
On 2020-12-16 16:42 +0100, Marc Nieper-Wißkirchen wrote:
> > a) Remove the new-key argument altogether.
> >
> > b) Ignore the value of the new-key argument and always use the pre-existing key.
> >
> > c) Use the new-key argument, but make it an error to provide one that is not the same (in the sense of the equality predicate) as the old key.
> >
> > d) No PFNs needed; update the implementations to allow arbitrary new-key values.
I second Marc's wonder about option (c). If the new key has to be
equal in the sense of the structure's equality relation, when does the
problem with eq? arise?
Unless I've missed something, (c) seems like the best option, for all
of the reasons already mentioned by John. (d) is plausible, but it
will probably ruin the possibility of using *-search forms as general
traversers. Taylor Campbell's comment on *-search without the same-key
restriction sums the situation up well, I think: "World's most
complicated lookup API that you have to define in terms of the simpler
ones!"
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"As Will Rogers would have said, 'There is no such thing as a
free variable.'" --Alan J. Perlis