On Tue, Jun 4, 2013 at 11:37 AM, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 6/4/2013 11:04 AM, John Colvin wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Tuesday, 4 June 2013 at 17:50:47 UTC, Walter Bright wrote:<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What value does a function which just passes an alias to another one add?<br>
</blockquote>
<br>
A unified interface called "compress" that takes a compression function as an<br>
alias (with e.g. lzwCompress as a default) seems like a nicer way of working,<br>
seeing as people don't necessarily care/know about which algorithm they're<br>
using, they just want to compress something a bit.<br>
<br>
Also, it would be cool if a range could remember which algorithm it was<br>
compressed with (as it's type? I.e. LzwRange), so a generic function "expand"<br>
could call the appropriate ***Expand<br>
</div></blockquote>
<br>
What is the improvement of typing:<br>
<br>
compress(lzw)<br>
<br>
over:<br>
<br>
lzwCompress()<br>
<br>
?<br>
</blockquote></div><br><div>writing generic code.</div><div>same reason as why we prefer:</div><div>auto y=to!double(x) over auto y=to_double(x);</div><div><br></div>