On Sat, Feb 20, 2010 at 21:48, Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
To focus the discussion about naming conventions, let&#39;s discuss one particular aspect. Right now we have in std.algorithm:<br></blockquote><div>(snip) <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

There are a few other functions like that: one version takes a range by value, the other takes it by reference and alters it.<br>
<br>
The question is, what is a good naming convention for expressing that? Other examples: findConsume, consumeFind</blockquote><div><br>Would using policies be a solution?<br><br>enum ModificationPolicy { doesNotModify, Modifies};<br>
<br>That way, you can keep the same name throughout the module.<br><br>And the same for eager or lazy versions of some algorithms. Map/Filter could be eager rather than lazy (though I like them lazy) and return an array.<br>
<br>Would that be possible, with well-thought defaults?<br><br><br>  Philippe<br><br><br> </div></div>