<div dir="ltr">Hi Chris,<div class="gmail_extra"><br></div><div class="gmail_extra">    interesting!</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 1:40 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I finally tracked down why the keys of the #knownEnvironments<br>
Dictionary were changing when trying to build an image in Spur.<br>
<br>
It&#39;s because, in my core-extensions package, I override<br>
UndefinedObject&gt;&gt;#hash to have hard-coded value independent of its<br>
#identityHash, to be safer with distributed systems which may be using<br>
nil in a hash calculation -- in case they would be different due to<br>
accessing with a Spur image, for example.<br>
<br>
Such a hash calculation is made for the keys of the #knownEnvironments<br>
Dictionary when the country&#39;s are nil.  By the different hash value in<br>
Spur, the image would lock when trying to load my core-extensions<br>
package, because it tried to access knownEnvironments as part of the<br>
load-operation itself.<br>
<br>
The least-lazy way to &quot;fix&quot; it was to ensure something is populated in<br>
the LocaleID&#39;s &#39;country&#39;s.  Whew!<br>
<br>
Anyway, something to be aware of -- anywhere we have true, false or<br>
nil used in a hash calculation, now has a different hash in Spur vs.<br>
Cog.  Maybe we should think about separating those objects&#39; logical<br>
&quot;value&quot; hash from their identityHash in trunk..?  That could be useful<br>
when we move to 64-bit someday..<br></blockquote><div><br></div><div> Remember that Spur has a common header format for both 32-bit and 64-bit versions, so in both there is a 22-bit identityHash and hence the identityHashes of all objects in a 64-bit Spur image bootstrapped from a 32-bit Spur image will be _unchanged_.  Convenient. So no need to worry.  And it should be the case that a freshly bootstrapped 64-bit Spur image does not need to be rehashed to function properly.</div><div><br></div><div>But while we&#39;re on the subject, one thing we could do is arrange that Symbols have an identityHash based on their value.  So when interning a string we&#39;d compute its string hash and derive and assign the identityHash of the Symbol from the string hash.  That would mean that when unpickling classes in e.g. Fuel we would not have to rehash method dictionaries, which would be very nice indeed.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">On Wed, Nov 12, 2014 at 3:26 PM,  &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt; Chris Muller uploaded a new version of System to project The Trunk:<br>
&gt; <a href="http://source.squeak.org/trunk/System-cmm.689.mcz" target="_blank">http://source.squeak.org/trunk/System-cmm.689.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: System-cmm.689<br>
&gt; Author: cmm<br>
&gt; Time: 12 November 2014, 3:19:56.156 pm<br>
&gt; UUID: a1ffba24-42ff-4391-9387-4e8ee20e6b2a<br>
&gt; Ancestors: System-ul.688<br>
&gt;<br>
&gt; Populate all LocaleID&#39;s &#39;country&#39;s.<br>
&gt;<br>
&gt; =============== Diff against System-ul.688 ===============<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: LocaleID class&gt;&gt;countryFor: (in category &#39;accessing&#39;) -----<br>
&gt; + countryFor: iso6391Code<br>
&gt; +       &quot;<a href="http://www.loc.gov/standards/iso639-2/php/code_list.php" target="_blank">http://www.loc.gov/standards/iso639-2/php/code_list.php</a>&quot;<br>
&gt; +       ^ iso6391Code<br>
&gt; +               caseOf:<br>
&gt; +                       { [&#39;af&#39;] -&gt; [&#39;Afrikaans&#39;].<br>
&gt; +                       [&#39;ca&#39;] -&gt; [&#39;Catalan&#39;].<br>
&gt; +                       [&#39;cs&#39;] -&gt; [ &#39;Czech&#39;].<br>
&gt; +                       [&#39;da&#39;] -&gt; [ &#39;Danish&#39;].<br>
&gt; +                       [&#39;de&#39;] -&gt; [ &#39;German&#39;].<br>
&gt; +                       [&#39;el&#39;] -&gt; [ &#39;Greek Modern&#39;].<br>
&gt; +                       [&#39;en&#39;] -&gt; [ &#39;English&#39;].<br>
&gt; +                       [&#39;es&#39;] -&gt; [ &#39;Spanish&#39;].<br>
&gt; +                       [&#39;eu&#39;] -&gt; [ &#39;Basque&#39;].<br>
&gt; +                       [&#39;fi&#39;] -&gt; [ &#39;Finnish&#39;].<br>
&gt; +                       [&#39;fo&#39;] -&gt; [ &#39;Faroese&#39;].<br>
&gt; +                       [&#39;fr&#39;] -&gt; [ &#39;French&#39;].<br>
&gt; +                       [&#39;ga&#39;] -&gt; [ &#39;Irish&#39;].<br>
&gt; +                       [&#39;gd&#39;] -&gt; [ &#39;Gaelic&#39;].<br>
&gt; +                       [&#39;hr&#39;] -&gt; [ &#39;Croatian&#39;].<br>
&gt; +                       [&#39;hu&#39;] -&gt; [ &#39;Hungarian&#39;].<br>
&gt; +                       [&#39;is&#39;] -&gt; [ &#39;Icelandic&#39;].<br>
&gt; +                       [&#39;it&#39;] -&gt; [ &#39;Italian&#39;].<br>
&gt; +                       [&#39;ja&#39;] -&gt; [ &#39;Japanese&#39;].<br>
&gt; +                       [&#39;ja-etoys&#39;] -&gt; [ &#39;Japanese&#39;].<br>
&gt; +                       [&#39;ko&#39;] -&gt; [ &#39;Korean&#39;].<br>
&gt; +                       [&#39;nl&#39;] -&gt; [ &#39;Dutch&#39;].<br>
&gt; +                       [&#39;no&#39;] -&gt; [ &#39;Norwegian&#39;].<br>
&gt; +                       [&#39;pt&#39;] -&gt; [ &#39;Portuguese&#39;].<br>
&gt; +                       [&#39;rm&#39;] -&gt; [ &#39;Romansh&#39;].<br>
&gt; +                       [&#39;ro&#39;] -&gt; [ &#39;Romainian&#39;].<br>
&gt; +                       [&#39;sk&#39;] -&gt; [ &#39;Slovak&#39;].<br>
&gt; +                       [&#39;sl&#39;] -&gt; [ &#39;Slovenian&#39;].<br>
&gt; +                       [&#39;sq&#39;] -&gt; [ &#39;Albanian&#39;].<br>
&gt; +                       [&#39;sv&#39;] -&gt; [ &#39;Swedish&#39;].<br>
&gt; +                       [&#39;sw&#39;] -&gt; [ &#39;Swahili&#39;].<br>
&gt; +                       [&#39;zh&#39;] -&gt; [ &#39;Chinese&#39;] }<br>
&gt; +               otherwise:<br>
&gt; +                       [ &#39;other&#39; ]!<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   ----- Method: LocaleID&gt;&gt;isoLanguage:isoCountry: (in category &#39;initialize&#39;) -----<br>
&gt; + isoLanguage: langString isoCountry: countryStringOrNil<br>
&gt; - isoLanguage: langString isoCountry: countryStringOrNil<br>
&gt;         isoLanguage := langString.<br>
&gt; +       isoCountry := countryStringOrNil ifNil: (self class countryFor: langString)!<br>
&gt; -       isoCountry := countryStringOrNil!<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   (PackageInfo named: &#39;System&#39;) postscript: &#39;&quot;Preferences already removed by hand, but whose state still lingers:&quot;<br>
&gt; + LocaleID allInstances do:<br>
&gt; +       [ : each | each<br>
&gt; +               isoLanguage: each isoLanguage<br>
&gt; +               isoCountry: (each isoCountry ifNil: [ each isoCountry ]) ].<br>
&gt; + LanguageEnvironment knownEnvironments rehash&#39;!<br>
&gt; - Preferences removePreference: #upgradeIsMerge.<br>
&gt; - Preferences removePreference: #colorWhenPrettyPrinting.<br>
&gt; - Preferences removePreference: #promptForUpdateServer.<br>
&gt; - Preferences removePreference: #updateSavesFile.<br>
&gt; - Preferences removePreference: #updateFromServerAtStartup.&#39;!<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>