<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 January 2014 00:07, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>This works fine:<br></div><div>  string x = find("Hello", 'H');</div><div><br></div><div>This doesn't:</div><div>  string y = find(retro("Hello"), 'H');<br></div>

<div>  > Error: cannot implicitly convert expression (find(retro("Hello"), 'H')) of type Result!() to string</div><div><br></div><div>Is that wrong? That seems to be how the docs suggest it should be used.</div>

<div><br></div><div>On a side note, am I the only one that finds std.algorithm/std.range/etc for string processing really obtuse?</div><div>I can rarely understand the error messages, so say it's better than STL is optimistic.</div>

<div>Using std.algorithm and std.range to do string manipulation feels really lame to me.</div><div>I hate looking through the docs of 3-4 modules to understand the complete set of useful string operations (std.string, std.uni, std.algorithm, std.range... at least).</div>

<div>I also find the names of the generic algorithms are often unrelated to the name of the string operation.</div><div>My feeling is, everyone is always on about how cool D is at string, but other than 'char[]', and the builtin slice operator, I feel really unproductive whenever I do any heavy string manipulation in D.</div>

<div>I also hate that I need to import at least 4-5 modules to do anything useful with strings... I feel my program bloating and cringe with every gigantic import that sources exactly one symbol.</div></div>
</blockquote></div><br></div><div class="gmail_extra">One more, again here to reduce spam...</div><div class="gmail_extra"><br></div><div class="gmail_extra">2 overloads exist:</div><div class="gmail_extra">void func(const(char)* str);</div>
<div class="gmail_extra">void func(const(char)[] str);<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Called with literal string:</div><div class="gmail_extra">func("literal");</div><div class="gmail_extra">
<br></div><div class="gmail_extra">called with argument types (string) matches both.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I appreciate the convenience of the automatic string literal -> const(char)* cast. But in this case, surely it should just choose the array version of the function, like it does it calling with a 'string' variable?</div>
<div class="gmail_extra">The convenience should be just that, a convenience, not a hard rule...?</div></div>