Re: Functional random data streams
Marc Nieper-Wißkirchen 05 May 2020 20:00 UTC
Am Di., 5. Mai 2020 um 21:45 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> While I generally agree it's a good thing to promote functional approach, I feel bringing it up in the generators is
> a bit off the spot. Generators are stateful, but it's rather a good nature---you can enclose non-functional parts
> within the generator world. E.g. gmap is not restart-safe, but its *obvious*, since output is also a generator so
> you can't possibly mistake it is functional. Lacking static typing, it is probably one of the better approaches to split
> functional and non-functional worlds.
I'm sorry if my posts sounded like general criticism against
generators. I have found them very useful and procedures like `read'
or `write' are naturally generators and accumulators, respectively. So
everything you do with them fits perfectly into the world of what SRFI
158 describes.
I have just wanted to make sure that for things like random sequences,
which make as much sense in the functional world, the SRFI 41
interface won't be forgotten. (If SRFI 41 compatible interfaces are
rare, people may start to write imperative code because it is better
supported, while functional code would have theoretically been a much
better choice.)