Need help how to get started with D ranges

monarch_dodra monarchdodra at gmail.com
Mon Mar 24 09:27:05 PDT 2014


On Monday, 24 March 2014 at 14:12:58 UTC, Uranuz wrote:
>> Have you read this: http://ddili.org/ders/d.en/ranges.html ?
>
> Yes I have read it. It's difficult to formulate the question in 
> English bu I'l try. In this example I searching for special 
> symbols '&' and '='. So when symbol found I use *save* method 
> of range to remember start of *name* or *value* string of URL 
> encoded param. Then I trying to find next special symbol. And 
> when I found it I need to take a slice and insert in result AA. 
> Should input range be RandomAccess for it? And if it's not 
> random access range should should I append this substring by 
> symbol to some temp variable and then (when delimiter found) 
> insert into Associative Array. So result is that I will 
> implement two different behaviours for InputRange and for 
> RandomAccessRange. Am I right or not?

If you want to be able to *slice*, then you need an 
`RandomAccessRange` with `hasSlicing`.

a RandomAccessRange is a special kind of ForwardRange, which 
itself is an Input Range.


More information about the Digitalmars-d-learn mailing list