Iota
jmh530
john.michael.hall at gmail.com
Fri Aug 5 11:09:46 UTC 2022
On Friday, 5 August 2022 at 00:56:04 UTC, Paul Backus wrote:
> On Thursday, 4 August 2022 at 22:36:57 UTC, H. S. Teoh wrote:
>>
>> Perhaps. But the question now is, where do we go from here?
>> How do we improve what we currently have?
>
> Phobos v2, I guess? Leave the problematic overloads behind, and
> tell people upgrading to use a different function if they need
> something fancier.
>
> Unless there's been a big policy reversal announced at DConf,
> my impression is that breaking changes to existing Phobos
> interfaces are off the table.
There is probably a balance here between simple low level
constructions but at the same time a convenient high level API.
As a user, I would just much rather be able to do something like
`x.iota(a, b)` where `x` could be anything that it might make
sense to call `iota` on (I like "Design by Introspection" with a
bit of duck typing thrown in).
The issue with something like `iota(n).map!(i =>
MyType.startValue + i)` is that I might have to write that all
the time as a user. From my perspective, I would rather put an
`iota` overload in `MyType`'s module if I can't have it as part
of `phobos`. From this perspective, `std.algorithm` should
support built-in types and other types could define their own
`iota` that call these.
More information about the Digitalmars-d
mailing list