Oh, I wish I knew that before!<div>I lost a lot of time thinking some magic stuff was messing with my arrays :P<div><br></div><div><br><div class="gmail_quote">On Fri, Mar 12, 2010 at 6:45 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Fri, 12 Mar 2010, Ricardo Moran wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, guys<br>
<br>
I&#39;m sorry if what I&#39;m about to ask is a newbie question but I&#39;m puzzled<br>
about a behavior I found today regarding Arrays.<br>
<br>
a1 := #(0 0 0 0).<br>
a2 := #(0 0 0 0).<br>
a1 == a2<br>
<br>
If I select the whole expression above and execute it on a workspace it<br>
returns true (meaning that a1 and a2 are the same object). If I execute each<br>
line separately it returns false.<br>
I don&#39;t understand why this happens. Is this expected? or is it a bug?<br>
<br>
This only happens when I use the literal syntax, using Array &gt;&gt;<br>
#new:withAll: works fine regardless of the way I execute it. I&#39;m inclined to<br>
think this is a bug, but I wanted to know what you think about it.<br>
</blockquote>
<br></div></div>
It&#39;s an optimization by the compiler. If the same literal object appears twice or more, only one object will be created.<br>
<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers<br>
Richo<br>
<br>
</blockquote>
<br>
</blockquote></div><br></div></div>