splitting numbers from a test file

Craig Dillabaugh cdillaba at cg.scs.carleton.ca
Wed Sep 19 10:22:39 PDT 2012


On Wednesday, 19 September 2012 at 06:09:38 UTC, Ali Çehreli
wrote:
> On 09/18/2012 09:56 PM, Craig Dillabaugh wrote:
> > On Wednesday, 19 September 2012 at 04:03:44 UTC, Jonathan M
> Davis
> > wrote:
>
> >> The documentation says that it returns a range.
>
> > From:
> > http://dlang.org/phobos/std_array.html#splitter
> >
> > The documentation (copied and pasted) for splitter reads:
> >
> > auto splitter(C)(C[] s);
> > Splits a string by whitespace.
> >
> > Example:
> > auto a = " a bcd ef gh ";
> > assert(equal(splitter(a), ["", "a", "bcd", "ef", "gh"][]));
>
> It is unfortunate that there is also the other splitter, which 
> at least implies ranges: :-/
>
>   http://dlang.org/phobos/std_algorithm.html#splitter
>
> Yes, the documentation can be much better.
>
> For example, the documentation for the second splitter above 
> looks exacly like the other one, except that one says "using an 
> element as a separator." while the other one says "using 
> another range as a separator".
>
> I think it is a ddoc limitation: Template constraints are not 
> included in documentation yet.
>
> Ali

Ali and Johnathan:
Thank you for your help. Also Ali thanks for your book, motivated
by this little problem I've started reading your Chapter on
ranges.  It is very helpful.

Cheers,
Craig



More information about the Digitalmars-d-learn mailing list