On 2009-04-11 00:00:08 -0400, Andrei Alexandrescu <[email protected]> said:

Thanks. Arrays aren't a problem, but non-random-access ranges are problematic. (For arrays a slice could also be taken.) That's why I've been reluctant - if I make before and after primitives, then anyone defining a range needs to worry about implementing them.

Then could it be limited to random-access ranges? Other ranges could provide their own implementation, if it makes sense for them. That'd make another category of ranges: "intersectable ranges".

We could just provide primitives for consuming a range and returning the consumed data (as my read function does above). This could be supported by all ranges.

Which makes me think: how does the new regex library handle consuming and backtracking with ranges?

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to