Sreachview api design

monkyyy crazymonkyyy at gmail.com
Fri Nov 22 19:25:12 UTC 2024


"Given an indexed range that represents an (ascii) file return an 
object that selects the nth line and implements unpoping(such 
that the user who called for line 3 can unpop onto line 5); 
design a good api and patterns for this object."

https://github.com/crazymonkyyy/debuglibprototype/blob/master/old/sreachview.d

The old range api sux at searching, so I want to add indexs to 
the range api, blah blah blah, I imagine most people have heard 
my rant. Given that I get my way or am outside the core devs 
ecosystem how do you use that tool for good searching of 
*slices*(i.e. once its more complex then just indexs)? My first 
thought was to have 2 random access+indexing ranges looking at 
the same data, but its kinda allot of functions and feels like 
its dipping into c++ iterators. My current thought is maybe 
array-like object with slicing + indexed range + some sort of 
wrapper for opSlice

any other ideas?


More information about the Digitalmars-d mailing list