I would like to momentarily return to a previous issue.<br><br>Before I said that the &quot;==&quot; operator doesn&#39;t cover identity in this sense; I was wrong and it does partially.<br><br>consider;<br><br>========<br>
Gain foo;<br>foo @=&gt; Gain bar;<br><br>//should be true<br>if (foo == foo) &lt;&lt;&lt;&quot;true&quot;&gt;&gt;&gt;;<br>else &lt;&lt;&lt;&quot;false&quot;&gt;&gt;&gt;;<br><br>//also true<br>if (foo == bar) &lt;&lt;&lt;&quot;true&quot;&gt;&gt;&gt;;<br>
else &lt;&lt;&lt;&quot;false&quot;&gt;&gt;&gt;;<br>============<br><br>As compared to;<br>=========<br><br>baz foo;<br>foo @=&gt; baz bar;<br>//will lead to a error as &quot;==&quot; isn&#39;t overloaded to extend to this<br>
if (foo == foo) &lt;&lt;&lt;&quot;true&quot;&gt;&gt;&gt;;<br>else &lt;&lt;&lt;&quot;false&quot;&gt;&gt;&gt;;<br><br>class baz<br>    {<br>    int member;<br>    }<br>==========<br><br>Now let&#39;s get tricky and try to write around the lack of overloading as at the testing stage we don&#39;t actually need the type;<br>
<br>==========<br>baz foo;<br>foo @=&gt; baz bar;<br>//this will yield a error at the casting<br>if (( foo $ Object) == ( bar $ Object)) &lt;&lt;&lt;&quot;true&quot;&gt;&gt;&gt;;<br>else &lt;&lt;&lt;&quot;false&quot;&gt;&gt;&gt;;<br>
<br><br>class baz<br>    {<br>    int member;<br>    }<br>=================<br><br>I believe this error to be another bug or omission in the type system. As a &quot;baz&quot; is clearly a object we should be able to cast it to Object. Because of this we won&#39;t -currently- be able to test for identity in trying to clean our array/set of identical objects. Of course we might still give a custom class a unique &quot;id-tag&quot; and test based on that.<br>
<br>Unless somebody explains why and how I&#39;m wrong in expecting the cast operator to extend to this usage I&#39;m going to file this as a bug to the wiki. Personally I also feel that &quot;(foo == bar)&quot; should return true iff &quot;(( foo $ Object) == ( bar $ Object)) &quot; returns true and that the &quot;==&quot; operator should be overloaded to cover that. There might be implications to that that but currently that seems to me like the way to go; casting is fun but not *that* much fun.<br>
<br>Yours,<br>Kas.<br>