`drop` not `opSlice` should be in the range api

monkyyy crazymonkyyy at gmail.com
Sun Jan 12 19:08:06 UTC 2025


On Sunday, 12 January 2025 at 17:48:48 UTC, Dukc wrote:
>  libraries usually do make a distinction between functions that 
> are intended for the user and functions that are intended 
> only/mainly for the library itself.

I consider it a mistake that phoboes hides the "meta" range 
algorithms separately in std.range (like zip) while 
`levenshteinDistanceAndPath` is in algorithm.

By virtue of the input api being the output api theres no real 
clear flow distinction; it is just a big mess, which is the power 
of the template hell but its also why it is just unreadable when 
theres minor syntax error that causes problems in some extreme 
edge case.

When you can (and should) write something small that impliments 
the range api, you may be swapping back and forth between mine 
and your code every other function, that isnt true of some json 
parser which may have some structure where they hide the 
conversion functions in a file and that can just be isolated.


More information about the Digitalmars-d mailing list