September 19, 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

September 19, 2012
On 09/19/2012 10:22 AM, Craig Dillabaugh wrote:

> 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.

Thank you. :)

Obviously, I am aware of its shortcomings. Especially, the difference between a container and a range must be stressed. The chapter touches on that idea at different places but I don't think it is spelled out sufficiently.

To be improved some time in the future... :)

Ali

1 2
Next ›   Last »