splitting numbers from a test file

Ali Çehreli acehreli at yahoo.com
Tue Sep 18 23:10:37 PDT 2012


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



More information about the Digitalmars-d-learn mailing list