<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 29, 2013 at 4:15 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:</div>
<div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Item was changed:<br>
----- Method: Environment>>at:ifAbsentPut: (in category 'emulating') -----<br>
at: aSymbol ifAbsentPut: aBlock<br>
+<br>
+ ^declarations<br>
- ^ declarations<br>
at: aSymbol<br>
+ ifAbsent: [ self at: aSymbol put: aBlock value ]!<br>
- ifAbsentPut: aBlock!<br></blockquote><div><br></div><div><br></div><div>Yup. We want to make use of the new become logic in #at:put: here too...</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Item was changed:<br>
----- Method: Environment>>at:put: (in category 'emulating') -----<br>
at: aSymbol put: anObject<br>
+<br>
+ | binding newBinding |<br>
+ newBinding := aSymbol => anObject.<br>
+ binding := declarations associationAt: aSymbol ifAbsent: [ nil ].<br>
+ binding ifNotNil: [<br>
+ binding class == newBinding class<br>
+ ifTrue: [ binding value: anObject ]<br>
+ ifFalse: [ binding becomeForward: newBinding ].<br>
+ ^anObject ].<br>
+ binding := undeclared associationAt: aSymbol ifAbsent: [ nil ].<br>
+ binding<br>
+ ifNil: [ binding := newBinding ]<br>
+ ifNotNil: [<br>
+ undeclared removeKey: aSymbol.<br>
+ binding class == newBinding class<br>
+ ifTrue: [ binding value: anObject ]<br>
+ ifFalse: [ binding becomeForward: newBinding ] ].<br>
+ declarations add: binding.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ references add: binding.<br>
</blockquote><div><br></div><div>I think the above line is problematic. It by by-passes all the import/export logic.</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ exports bind: binding. "Do we really want this?"<br></blockquote><div><br></div><div>Yes.</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ ^anObject<br><br>
Item was changed:<br>
----- Method: Environment>>removeKey:ifAbsent: (in category 'emulating') -----<br>
removeKey: key ifAbsent: aBlock<br>
+<br>
+ (declarations includesKey: key) ifFalse: [ ^aBlock value ].<br>
+ references removeKey: key ifAbsent: [].<br></blockquote><div><br></div><div>Again, the above line by-passes all the import/export logic. </div><div><br></div><div> </div><div>Colin</div><div><br></div></div><br></div>
</div>