Iota

monkyyy crazymonkyyy at gmail.com
Thu Aug 4 18:52:28 UTC 2022


On Thursday, 4 August 2022 at 16:28:14 UTC, React wrote:
> it assumes that every type supporting increment operators will 
> generate a nice, consecutive, ordered sequence of values.
>
> Iota specialises on floating point values exactly because of 
> the problem above, but assumes that *any* other type will 
> nicely behave as long you can put a ++ near a value.

I disagree the issue is that the std is to general; I believe the 
issue is that they dont stop adding details to this or that 
template and try to bandaid issues.

If a 10 line function works in 90% of cases but is hard to extand 
to be correct 100% of the time; the simpler version would be 
perferable. But instead they use template constains and traits 
and who knows what else to try to narrow down edge cases for big 
chunks of the std.

Iota could be split into a 10 line function called counter that 
returns int from a range and countby would return x while x<y; 
x+= z and would fit a float use case which would probaly be 
anouther 10 lines

If the code was approachable you could allow more edge cases as 
its would be easier to debug; but theres gaint 1k line functions 
and most poeple including me treat reading the std as a last 
resort


More information about the Digitalmars-d mailing list