fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (11 Jun 2021 18:15 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (11 Jun 2021 20:15 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (11 Jun 2021 22:27 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (12 Jun 2021 16:44 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (12 Jun 2021 19:58 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (12 Jun 2021 19:15 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (12 Jun 2021 20:07 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (12 Jun 2021 22:18 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (12 Jun 2021 22:20 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (13 Jun 2021 08:36 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (13 Jun 2021 19:19 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (13 Jun 2021 19:39 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 00:18 UTC)
(missing)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 14:53 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 14:59 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 15:15 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 15:42 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 15:44 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 15:41 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 16:10 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 16:28 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 17:12 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 18:27 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 18:43 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (14 Jun 2021 05:50 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (14 Jun 2021 07:40 UTC)
Re: fxmapping-unfold(-maybe) John Cowan (12 Jun 2021 23:54 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (13 Jun 2021 14:13 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (15 Jun 2021 04:18 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (15 Jun 2021 06:16 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (15 Jun 2021 09:44 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (15 Jun 2021 10:37 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (15 Jun 2021 14:20 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (15 Jun 2021 14:33 UTC)
Re: fxmapping-unfold(-maybe) John Cowan (15 Jun 2021 23:08 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (16 Jun 2021 06:48 UTC)
Re: fxmapping-unfold(-maybe) John Cowan (18 Jun 2021 03:01 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (18 Jun 2021 06:26 UTC)
Re: fxmapping-unfold(-maybe) Ray Dillinger (20 Jun 2021 04:08 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (20 Jun 2021 04:28 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (20 Jun 2021 08:00 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (20 Jun 2021 16:17 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (20 Jun 2021 16:19 UTC)
Re: fxmapping-unfold(-maybe) Arthur A. Gleckler (20 Jun 2021 16:25 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (17 Jun 2021 17:32 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (17 Jun 2021 18:00 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (17 Jun 2021 21:25 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (18 Jun 2021 06:09 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (19 Jun 2021 22:05 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (20 Jun 2021 07:00 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (20 Jun 2021 07:36 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (20 Jun 2021 08:31 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (20 Jun 2021 09:10 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (20 Jun 2021 10:44 UTC)
Re: fxmapping-unfold(-maybe) Shiro Kawai (20 Jun 2021 21:39 UTC)
Re: fxmapping-unfold(-maybe) Marc Nieper-Wißkirchen (21 Jun 2021 06:09 UTC)
Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe (17 Jun 2021 18:01 UTC)
Re: fxmapping-unfold(-maybe) John Cowan (12 Jun 2021 04:06 UTC)

Re: fxmapping-unfold(-maybe) Wolfgang Corcoran-Mathe 14 Jun 2021 00:18 UTC

On 2021-06-13 21:39 +0200, Marc Nieper-Wißkirchen wrote:
> > > We could, actually, make the CPS protocol even more expressible and
> > useful
> > > by removing the restriction that update/remove/insert/ignore have to be
> > > tail-called. Just let them return the updated fxmapping and let the
> > > continuation of the call to success/failure to be the continuation of
> > > fxmapping-search.
> >
> > This does make a lot of sense to me, and I'd be more in favor of
> > CPS procedures if we could get rid of the tail-call requirement.
> > To express this, would it be sufficient to write, e.g. "invoking
> > ignore on no values returns a fxmapping ...", rather than the
> > old "... is expected to tail-call one of them ..." wording?
>
> For the functional update procedures, I think the change is as simple as
> this.

This works for the semantics of all of the CPS/Maybe procedures of
SRFI 224 except for fxmapping-unfold and fxmapping-map-either; with
these procedures, there are still continuations that must be
tail-called; they trigger the next step of the computation rather than
producing the final result.  e.g.  in

    (fxmapping-unfold*
     (lambda (seed stop insert&continue) ...)
     initial-seed)

it is meaningless (and thus unspecified or, possibly, an error) to
call `insert&continue' except in tail-context; `stop', on the other
hand, returns the new fxmapping, and so can be meaningfully called for
a value.  I'm not entirely satisfied with this, but it is confined to
these two procedures.

I'm willing to convert SRFI 224's Maybe-based forms to CPS if we can
just find good names for this second unfold and for
fxmapping-map-either.  (I don't want to foist Maybe on the Scheme
world, in any case.)  The only name for the CPS version of
fxmapping-unfold-maybe that I have so far is fxmapping-unfold*,
which is probably unwise.  For fxmapping-map-either, I considered
fxmapping-fork-map, which at least is less confusing than split-map
or partition-map.

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

"A LISP programmer knows the value of everything, but the cost
of nothing." --Alan J. Perlis