Hi Igor,<br><br><div class="gmail_quote">On Mon, Jul 11, 2011 at 4:30 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Levente, your change is a bit dangerous,<br>
because if i remember correctly, not all primitives normalizing large integers.<br>
So, it is fairly possible to have large integer with value in a range<br>
of small integer.<br></blockquote><div><br></div><div>It is difficult to construct such a beast.  If one uses the interpreterProxy API, positive32BitIntegerFor et al you&#39;ll always obtain something normalized.  AFAIA, the only way one can create something unnormalized is by asking for a large integer and then altering its contents. So for me this isn&#39;t a dangerous change and requiring VM code to always deal with normalized integers seems rational and dependable to me.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Not saying , that one can manipulate largeinteger bits directly, and<br>
then use it later in comparison,<br>
which will fail due to your changes.<br>
So, such change requiring strong guarantees that you cannot create<br>
large integers which is in range of small integers.<br>
<div><div></div><div class="h5"><br>
On 10 July 2011 16:36,  &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt; Levente Uzonyi uploaded a new version of Kernel to project The Trunk:<br>
&gt; <a href="http://source.squeak.org/trunk/Kernel-ul.604.mcz" target="_blank">http://source.squeak.org/trunk/Kernel-ul.604.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: Kernel-ul.604<br>
&gt; Author: ul<br>
&gt; Time: 10 July 2011, 4:36:20.467 pm<br>
&gt; UUID: f758876f-a507-404b-aa2f-2c1038504b48<br>
&gt; Ancestors: Kernel-bf.603<br>
&gt;<br>
&gt; Optimized Integer &gt;&gt; #= for integer-integer comparisons. Return false for integers from different classes without further checking.<br>
&gt;<br>
&gt; =============== Diff against Kernel-bf.603 ===============<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;  ----- Method: Integer&gt;&gt;= (in category &#39;comparing&#39;) -----<br>
&gt;  = aNumber<br>
&gt; +<br>
&gt; +       aNumber isInteger ifTrue: [<br>
&gt; +               aNumber class == self class ifFalse: [ ^false ].<br>
&gt; +               ^(self digitCompare: aNumber) = 0 ].<br>
&gt; +       aNumber isNumber ifFalse: [ ^false ].<br>
&gt; +       ^aNumber adaptToInteger: self andCompare: #=!<br>
&gt; -       aNumber isNumber ifFalse: [^ false].<br>
&gt; -       aNumber isInteger ifTrue:<br>
&gt; -               [aNumber negative == self negative<br>
&gt; -                       ifTrue: [^ (self digitCompare: aNumber) = 0]<br>
&gt; -                       ifFalse: [^ false]].<br>
&gt; -       ^ aNumber adaptToInteger: self andCompare: #=!<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
</div></div>Best regards,<br>
<font color="#888888">Igor Stasenko AKA sig.<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>best,<div>Eliot</div><br>