How should to!string handle infinite ranges?
monkyyy
crazymonkyyy at gmail.com
Tue Mar 4 18:13:14 UTC 2025
On Tuesday, 4 March 2025 at 10:38:24 UTC, Paul Backus wrote:
> We're currently having a discussion about this [on Github][1].
> The way I see it, there are two reasonable choices:
>
> 1. Return a finite string indicating that the range was
> infinite. For example, `"[1, 2, 3, ...]"`.
>
> 2. Fail to compile and print a meaningful error message using
> `static assert`. For example, `Can't convert an infinite range
> to a string`.
>
> As a D programmer, which behavior would you find more useful or
> less surprising?
>
> [1]: https://github.com/dlang/phobos/pull/10660
`to` needs to be split up
`prettyprint` should truncate *everything* to 120 chars
More information about the Digitalmars-d
mailing list