Re: Failure continuations for fxmapping-update and friends
Wolfgang Corcoran-Mathe 22 Jun 2021 17:10 UTC
On 2021-06-22 07:41 +0200, Marc Nieper-Wißkirchen wrote:
> Am Di., 22. Juni 2021 um 03:44 Uhr schrieb Wolfgang Corcoran-Mathe <
> xxxxxx@sigwinch.xyz>:
>
> > On 2021-06-21 07:16 +0200, Marc Nieper-Wißkirchen wrote:
> > > (2) 'fxmapping-alter' is quite a bit more complicated than
> > > 'fxmapping-update', so if it is easy to add optional failure and success
> > > continuation to 'fxmapping-update', I'd rather do this then telling
> > people
> > > to use 'fxmapping-alter' as a substitute.
> >
> > I missed a point in here. A success procedure for fxmapping-update
> > would likely accept the results returned by 'proc' (the "updater"),
> > correct?
> >
> > (fxmapping-update (fxmapping 0 'a)
> > 0
> > (lambda (k v replace delete)
> > (replace "a"))
> > (lambda () #f)
> > fxmapping->alist)
> > ⇒ ((0 . "a"))
>
> Yes, it's superfluous here. It's probably a good idea not to add an
> optional SUCCESS. (As it can always be added later, but not removed to
> maintain compatibility.)
OK. I've left fxmapping-update alone.
> I promise not to take another look at it so it can be finalized. :)
>
> (The only thing which I think that still should be fixed are the first
> paragraphs under specification. When you don't want to follow my proposal
> of using record semantics to get it right, we have to come up with
> something different that makes sense. At the moment, for example, it is not
> guaranteed that something like, say, '(fxmapping? (mapping
> fixnum-comparator))' returns false.)
I hope I can make it clear that I appreciate your work on this. I
like this proposal, I'd like to discuss it further, and I hope we can
use it to make the type specifications of SRFIs more meaningful. I'm
simply not in favor of adopting it (in full strictness) for SRFI 224
at a late date without knowing the exact impact it will have. In
particular, I'd like to hear from more Scheme implementers as to what
it means for them.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"I think, to most people, scripting is a lot like obscenity. I can't
define it, but I'll know it when I see it." --Larry Wall