www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Sreachview api design

reply monkyyy <crazymonkyyy gmail.com> writes:
"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?
Nov 22
parent monkyyy <crazymonkyyy gmail.com> writes:
On Friday, 22 November 2024 at 19:25:12 UTC, monkyyy wrote:
 any other ideas?
https://gist.github.com/crazymonkyyy/aa160866198b7f56bc6145464204d87b
Nov 23