I think it&#39;s safe to say this is pretty much duck-typing in D (?)<div>So then, if duck! is used, it puts emphasis on what the function allows D to do (duck-typing),</div><div>while if as! is used, it sounds more intuitive (kinda like &quot;.respond_to?&quot; in Ruby) .</div>

<div><br></div><div>So going with my previous statement,</div><div>if you keep using duck!, or adaptTo!, or whatever this becomes, it will eventually stick and will sound intuitive no matter what.</div><div>In that way, I think as! is not necessarily such a good choice.</div>

<div><br></div><div>Also, I really agree with Kagamin and Walter&#39;s argument, that simply the name &quot;duck!&quot; would raise awareness for this features.<br><br><div class="gmail_quote">2010/10/16 so <span dir="ltr">&lt;so@so.do&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Reading wikipedia, definition and the examples exactly match adaptTo. Before naming it, i think we should first be clear about if it is really duck-typing or not.<div>

<div></div><div class="h5"><br>
<br>
On Sat, 16 Oct 2010 21:44:51 +0300, Michel Fortin &lt;<a href="mailto:michel.fortin@michelf.com" target="_blank">michel.fortin@michelf.com</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2010-10-16 14:32:10 -0400, Walter Bright &lt;<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>&gt; said:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nobody is going to start using D because it has a function *named* duck.<br>
</blockquote>
 Maybe not, but it will raise awareness that &quot;D has duck typing&quot;. Otherwise, I guarantee you that people will argue that &quot;I need duck typing, and Z has it and D does not&quot; if it is named adaptTo.<br>
</blockquote>
<br>
The problem is that D doesn&#39;t have duck-typing. The adapter pattern isn&#39;t duck-typing. Duck-typing is when you have an object and can call a &#39;quack&#39; function on it and if there&#39;s no &#39;quack&#39; function you get a runtime error.<br>


<br>
It&#39;s like saying D is a dynamic language, people will know you&#39;re bullshitting them.<br>
<br>
</blockquote>
<br>
<br>
-- <br></div></div><div><div></div><div class="h5">
Using Opera&#39;s revolutionary e-mail client: <a href="http://www.opera.com/mail/" target="_blank">http://www.opera.com/mail/</a><br>
</div></div></blockquote></div><br></div>