<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-09-30 11:32 GMT+02:00 Tim Felgentreff <span dir="ltr"><<a href="mailto:timfelgentreff@gmail.com" target="_blank">timfelgentreff@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The behavior before would look up aSymbol in the environment of the superclass. Now we'll have to import it into the environment of the subclass. Is that the desired new behavior?</div><div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div>Yes please, explicitely import the superclass environment (see #import:).<br></div><div><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_quote"><div dir="ltr">On Fri, 30 Sep 2016 at 11:23 Tim Felgentreff <<a href="mailto:timfelgentreff@gmail.com" target="_blank">timfelgentreff@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This breaks compiling EToys scripts when those refer to global classes. I probably don't understand something here, but for context, EToys players are not in the global environment, they create their own otherwise empty environment.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, 29 Sep 2016 at 10:19 <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas Cellier uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-nice.1042.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>trunk/Kernel-nice.1042.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-nice.1042<br>
Author: nice<br>
Time: 29 September 2016, 10:15:16.009388 am<br>
UUID: 8923b113-72cf-414e-802c-<wbr>cef7c50f8ad1<br>
Ancestors: Kernel-tfel.1041, Kernel-nice.798<br>
<br>
Merge Kernel-nice.798 (variable scope fix, don't resolve name in superclass environment)<br>
<br>
Reminder: this requires some Smalltalk exportSelf.<br>
<br>
=============== Diff against Kernel-tfel.1041 ===============<br>
<br>
Item was changed:<br>
----- Method: Class>>bindingOf:environment: (in category 'compiling') -----<br>
bindingOf: varName environment: anEnvironment<br>
"Answer the binding of some variable resolved in the scope of the receiver"<br>
| aSymbol binding |<br>
aSymbol := varName asSymbol.<br>
<br>
+ "First look in local classVar dictionary."<br>
+ binding := self classPool bindingOf: aSymbol.<br>
+ binding ifNotNil:[^binding].<br>
- "First look in classVar dictionary."<br>
- (self classThatDefinesClassVariable: aSymbol) ifNotNil:<br>
- [:x | ^x classPool bindingOf: aSymbol].<br>
<br>
+ "Next look in local shared pools."<br>
- "Next look in shared pools."<br>
self sharedPools do:[:pool |<br>
binding := pool bindingOf: aSymbol.<br>
binding ifNotNil:[^binding].<br>
].<br>
<br>
+ "Next look into superclass pools"<br>
+ superclass ifNotNil: [^ superclass bindingOf: aSymbol environment: anEnvironment].<br>
+<br>
+ "No more superclass... Last look in declared environment."<br>
+ ^anEnvironment bindingOf: aSymbol<br>
- "Next look in declared environment."<br>
- binding := anEnvironment bindingOf: aSymbol.<br>
- binding ifNotNil:[^binding].<br>
<br>
- "Finally look higher up the superclass chain and fail at the end."<br>
- superclass == nil<br>
- ifTrue: [^ nil]<br>
- ifFalse: [^ superclass bindingOf: aSymbol].<br>
-<br>
!<br>
<br>
<br>
</blockquote></div></blockquote></div>
</div></div><br><br>
<br></blockquote></div><br></div></div>