Familiar with hashes. Grok it; I can use it to see if two objects are the same object or not, and looking for a particular object by it&#39;s hash is probably expensive.<div><br></div><div>Thank you:)<br><br><div class="gmail_quote">
On Tue, Aug 18, 2009 at 9:38 PM, Michael van der Gulik <span dir="ltr">&lt;<a href="mailto:mikevdg@gmail.com">mikevdg@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;">
<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Aug 19, 2009 at 4:19 PM, Ronald Spengler <span dir="ltr">&lt;<a href="mailto:ron.spengler@gmail.com" target="_blank">ron.spengler@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
When I (for example,) in a workspace, Command-P the text &#39;morph3874 color: Color red&#39; and see &#39;aMorph(2413)&#39;, what does the number mean? I&#39;m guessing it&#39;s some kind of object pointer. An OOP perhaps, I&#39;ve heard people speak of those? This has been bugging me for a year, and I can&#39;t seem to construct a Google string that finds me an answer to the question. Can I use that number to find the object in the object memory?<div>


<br></div><div>Why I ask:</div><div><br></div><div>I&#39;m presently trying to understand...</div><div><br></div><div><a href="http://bugs.squeak.org/bug_view_page.php?bug_id=456" target="_blank">http://bugs.squeak.org/bug_view_page.php?bug_id=456</a></div>

<br></blockquote></div><br></div></div>Look at the code in Morph&gt;&gt;printOn:<br><br>Morph&gt;&gt;printOn: aStream <br>    | aName |<br>    super printOn: aStream.<br>    (aName := self knownName) notNil <br>        ifTrue: [aStream nextPutAll: &#39;&lt;&#39; , aName , &#39;&gt;&#39;].<br>

    aStream nextPutAll: &#39;(&#39;.<br>    aStream<br>        print: self identityHash;<br>        nextPutAll: &#39;)&#39;<br><br>This gets called when you do alt-p on a morph in a workspace. The second-to-last line is of interest; this is the number that you&#39;re seeing. It&#39;s an &quot;identityHash&quot;. I&#39;m not going to explain hashing here; Wikipedia can teach you more if you&#39;re curious.<br>

<br>If you look at the implementation of ProtoObject&gt;&gt;identityHash, it is primitive 75. If you look at the implementation of Object&gt;&gt;asOop, it is also primitive 75. So, coincidentally, yes, it is an OOP (object pointer).<br>

<br>The intention however was just to print out a number that is unique for each different instance so that you can see whether two variables are pointing to the same morph. This is useful for debugging. In my own images, I often modify printOn: methods to print out hashes or oops for the same reason.<br>

<br>I&#39;m not sure how you&#39;d convert an oop to an object. I guess you could search through all objects in the image looking for the right one.<br><br>Gulik.<br clear="all"><font color="#888888"><br>-- <br><a href="http://gulik.pbwiki.com/" target="_blank">http://gulik.pbwiki.com/</a><br>


</font><br><br>
<br></blockquote></div><br></div>