October 14, 2012
On Monday, October 15, 2012 01:11:28 Mehrdad wrote:
> How are you supposed to split a range that doesn't support slicing though?
> 
> You can't just call array() because it might be too big to be reasonable for fitting it into memory...

If you're splitting on an element, slicing isn't necessary. It's only splitting on a range that requires slicing. However, because splitter is lazy, I would think that it would be perfectly possible to define it such that it didn't need slicing. It would still need a forward range (for the same reason that find requires forward ranges if it's not looking for a single element), but I would think that you could define it with just forward ranges. Worst case, the result would have to be a range over Take!Range rather than over slices of Range, and that's basically what infinite ranges have to do when slicing anyway. So, unless I'm missing something, I think that splitter is currently being overly restrictive in its implementation.

- Jonathan M Davis
1 2
Next ›   Last »