<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 5, 2012 at 1:28 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2012-11-03, at 22:45, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>

<br>
&gt; On Sat, Nov 3, 2012 at 3:26 PM, Edgar J. De Cleene &lt;<a href="mailto:edgardec2005@gmail.com">edgardec2005@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Folks:<br>
&gt;&gt;<br>
&gt;&gt; I wish know how old a object is.<br>
&gt;&gt;<br>
&gt; The VM can know if an object is in the young or old area. You could modify the VM and make a primitive that answers this (#isYoung: anOop).<br>
<br>
</div>What&#39;s wrong with the existing primitiveIsYoung? ;)<br>
<br></blockquote><div><br></div><div>Sorry, I though we only had #isYoung:  and I forgot we also had the primitiveIsYoung and even the image side message :)</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

SmalltalkImage current isYoung: true<br>
==&gt; false<br>
<br>
SmalltalkImage current isYoung: Object new<br>
==&gt; true<br>
<br>
<br>
Also, since our GC does not change the order of objects when compacting, you can tell if an object is older than another by enumerating all objects. The oldest ones are of course nil, false, and true (more than 30 years old now):<br>

<br></blockquote><div><br></div><div><br></div><div>This is very interesting!!! </div><div>Thanks Bert. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

(1 to: 20) inject: self someObject into: [:obj :i |<br>
        Transcript show: i; space; show: (obj printString contractTo: 60); cr.<br>
        obj nextObject]<br>
==&gt;<br>
1 nil<br>
2 false<br>
3 true<br>
4 #Processor-&gt;a ProcessorScheduler<br>
5 #(#+ 1 #- 1 #&lt; 1 #&gt; 1 #&lt;= 1 #... 1 #new 0 #new: 1 #x 0 #y 0)<br>
6 {Character value: 0 . Charact...$ú . $û . $ü . $ý . $þ . $ÿ}<br>
7 {CompiledMethod . nil . Array...nil . nil . nil . nil . nil}<br>
8 #Transcript-&gt;a TranscriptStream &#39; &#39;<br>
9 #SourceFiles-&gt;an ExpandedSour...s/Work/Frank/frank.changes&#39;)<br>
10 #Display-&gt;DisplayScreen(1920x1200x32)<br>
11 #Sensor-&gt;an EventSensor<br>
12 $&#39;<br>
13 $,<br>
14 $-<br>
15 $.<br>
16 $0<br>
17 $;<br>
18 $=<br>
19 $[<br>
20 $_<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
- Bert -<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>
</div>