Re: Functional random data streams Marc Nieper-Wißkirchen 05 May 2020 10:58 UTC

Am Di., 5. Mai 2020 um 12:02 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> In my experience generators don't pose much problems, as I treat it in the same family of read-char and read-u8.
> As soon as you fiddle with call/cc, you can just convert it to a lazy sequence and forget about generators.
>
> Restart safety in general (i.e. re-invoking continuation captured within higher-order functions won't break things)
> is another topic---there are not many procedures that explicitly require it, and I think many existing code
> actually have internal state which may be revealed if a continuation captured in a higher-order function is restarted.

That's one of the reasons why we should promote the pure versions
(like streams) no less than the impure ones (like generators). :)

> For example, srfi-133 vector-unfold is not restart safe (it doesn't specify so, and reference implementation isn't).

This is unpleasant insofar as VECTOR-UNFOLD is supposed to be the
fundamental vector constructor but would be insufficient to implement
VECTOR-MAP.