std.v2020.algorithm etc[ WAS: Is run.d going to be expand for runtime and the phobos library?]

Paul Backus snarwin at gmail.com
Mon Jun 29 17:49:29 UTC 2020


On Monday, 29 June 2020 at 15:40:28 UTC, Stanislav Blinov wrote:
> We can't implement a buffering range in terms of the `next()` 
> interface, a staggered fetch + advance is required. (next() may 
> overwrite the internals of the buffer before client has a 
> chance of reading the value).

Are you referring to ranges like `byLine` that invalidate the 
previous front when popFront is called? If so, I don't see what 
difference it makes whether they're implemented with next() or 
some other interface.

If that's not what you're referring to, can you give an example?

> :) Fine. An input range can't exist without mutable state. Is 
> that statement more agreeable for you?

Yes, that's much more agreeable. :)

Personally, I am concerned here with how to make ranges work with 
D's `const` and `immutable` qualifiers. So the fact that there 
may be mutable state out there somewhere in libc/the kernel/the 
filesystem doesn't bother me.


More information about the Digitalmars-d mailing list