<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 23, 2015 at 4:49 PM, Vladimir Panteleev via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, 23 June 2015 at 23:17:54 UTC, Meta wrote:<br>
</span><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I really hate this naming scheme for functions that take lazy parameters. I still don't see why we don't do the (IMO) simplest and most intuitive thing and name them lazyToLower / lazyToUpper (or toLowerLazy / toUpperLazy). There is precedent with C#'s handling of async functions; for example, AccessTheWebAsync or GetStringAsync[1]. Your proposed naming scheme seems like it's trying to be too "clever" and really just ends up causing unnecessary confusion. This is not Ruby.<br>
[1]<a href="https://msdn.microsoft.com/en-us/library/hh191443.aspx" rel="noreferrer" target="_blank">https://msdn.microsoft.com/en-us/library/hh191443.aspx</a><br>
</blockquote>
<br></span>
I'm not sure about this... I've seen another proposal for a "lazy" suffix in the other thread, but I think this won't be great in the long run:<br>
<br>
- Ultimately, we want to encourage use of the lazy versions, in the same way that e.g. std.algorithm and std.range are encouraged over eager operations for arrays.<br>
<br>
- There is no consistency with any existing naming schemes. Currently no names in Phobos contain the word "Lazy".<br>
<br>
- If std.algorithm were to follow this convention, it would have lazyJoin instead of joiner, lazySplit instead of splitter, lazyConcat OSLT instead of chain, etc. Given a typical program using std.algorithm, do you think such names would look better there than the current ones?<br>
<br>
- I'm not sure about the C# async analogy: with "async", the methods are used in a different way. The new range-based functions are used in the same way, but work on different types.<br>
<br>
Here's an example program using setExt[ension] and toLower[Case], in 4 variants...<br>
<br>
<a href="https://gist.github.com/CyberShadow/5cc7e926f566d56a672f" rel="noreferrer" target="_blank">https://gist.github.com/CyberShadow/5cc7e926f566d56a672f</a><br>
<br>
IMHO, in this case, the "Lazy" suffix is a distracting technicality that doesn't carry its weight. Am I the only one?<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">+1</div><div class="gmail_extra"><br></div><div class="gmail_extra">If I'd seen this two minutes ago could have saved me some typing.</div></div>