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 14:53 UTC

On 2021-06-14 10:23 +0200, Marc Nieper-Wißkirchen wrote:
> Am Mo., 14. Juni 2021 um 02:18 Uhr schrieb Wolfgang Corcoran-Mathe <
> xxxxxx@sigwinch.xyz>:
>
> >     (fxmapping-unfold*
> >      (lambda (seed stop insert&continue) ...)
> >      initial-seed)
> >
>
> NB: SEED should come last to allow multiple seed values.

Yes.  Thanks, good catch.

> > 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.
>
> To remedy the problem with fxmapping-unfold*, change the semantics of STOP.
> It shall abandon the current continuation and pass the resulting fxmapping
> to the continuation of the call to fxmapping-unfold*. Make INSERT&CONTINUE
> implicit by returning to the continuation of the call to the callback.

Ah, excellent.  This is much simpler.

As a side note on naming, I think `fxmapping-accumulate' is a
good name; the only concern I have about it is that the very well-known
SICP used it to describe a fold procedure.

---

There is another issue I've found with replacing Maybe or the
"expected tail-call" semantics in fxmapping-update.  Consider this
silly example:

    (fxmapping-update key
                      fxmap
                      (lambda (k v replace delete)     ; updater
                        (values 'deleted (delete))))

This must be valid if we state that invoking `delete' returns the
updated fxmapping.  However, I believe that this constrains
fxmapping-update to calling the updater procedure in tail-context,
which may be inconvenient for some implementations (i.e. those
using structures which are naturally constructed via recursion).

This doesn't arise if we use required tail-calls or Maybe.

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

"A picture is worth 10k words--but only those to describe the picture.
Hardly any sets of 10k words can be adequately described with pictures."
--Alan J. Perlis