On Thursday, 9 January 2014 at 17:15:43 UTC, Regan Heath wrote:

clip


In other words, why can't we alias or wrap the generic routines in std.string such that the expected operations are easy to find and do exactly what you'd expect, for strings.

If someone is dealing with generic code where the ranges involved might be strings/arrays or might be something else of course they will call std.range functions, but if they are only dealing with strings there should be string specific functions for them to call - which may/may not use std.range or std.algorithm functions etc behind the scenes.

R

I think this would be a nice solution. I only use D for string processing rarely and as a result I always struggle a bit, because I can never remember where to go to look for things. Happily, my most recent experience with it was fairly smooth.

A while ago I was trying to do something with splitter on a string and I ended up asking a question on D.learn. I got into a very confusing debate because the person trying to help me thought I was using the splitter in std.array and I was using the one from another module (see the last few posts from here):

http://www.digitalmars.com/d/archives/digitalmars/D/learn/splitting_numbers_from_a_test_file_39448.html

It would be nice if std.string in D provided a nice, easy, string manipulation that swept most of the difficulties under the table, and provided links in the documentation to the functions they wrap for when people want to do more complex things.

Reply via email to