[squeak-dev] The Trunk: Tools-eem.1064.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Wed Sep 8 12:27:49 UTC 2021


In this case, the shadows were actually kind of intended because the field blocks should never refer to the receiver instance ...

Not sure how we can ensure this otherwise. At least we have tests for the "copy expression" feature which depends on this invariant.


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Mittwoch, 8. September 2021 05:38:07
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Tools-eem.1064.mcz

Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1064.mcz

==================== Summary ====================

Name: Tools-eem.1064
Author: eem
Time: 7 September 2021, 8:38:04.292324 pm
UUID: 2544ee88-6941-42d9-bc13-e3b384fb4708
Ancestors: Tools-ul.1063

Fix some shadowed inst var warnings in the inspector; 'object' is an inst var name but was used as a block arg name in a few methods.

=============== Diff against Tools-ul.1063 ===============

Item was changed:
  ----- Method: BasicInspector>>fieldSelf (in category 'fields') -----
  fieldSelf

         ^ (self newFieldForType: #self key: #self)
                 name: 'self'; emphasizeName;
+                valueGetter: [:obj | self basicObjectPrintString]; printValueAsIs;
-                valueGetter: [:object | self basicObjectPrintString]; printValueAsIs;
                 valueGetterExpression: 'self';
+                valueSetter: [:obj :value | self object: value];  "Switch to another object-under-inspection."
-                valueSetter: [:object :value | self object: value];  "Switch to another object-under-inspection."
                 yourself!

Item was changed:
  ----- Method: BasicInspector>>streamInstanceVariablesOn: (in category 'fields - streaming') -----
  streamInstanceVariablesOn: aStream

         | attributesForInstVars |
         attributesForInstVars :=  (UserInterfaceTheme current get: #instVar for: #SHTextStylerST80) ifNil: [#()].

         (thisContext objectClass: self object) allInstVarNames withIndexDo: [:name :index |
                 aStream nextPut: ((self newFieldForType: #instVar key: name)
                         name: name; styleName: attributesForInstVars;
+                        valueGetter: [:obj | thisContext object: obj instVarAt: index];
-                        valueGetter: [:object | thisContext object: object instVarAt: index];
                         valueGetterExpression: ('thisContext object: {1} instVarAt: {2}' format: { 'self'. index });
+                        valueSetter: [:obj :value | thisContext object: obj instVarAt: index put: value];
-                        valueSetter: [:object :value | thisContext object: object instVarAt: index put: value];
                         yourself)].!

Item was changed:
  ----- Method: Inspector>>fieldAllInstVars (in category 'fields') -----
  fieldAllInstVars

         ^ (self newFieldForType: #all key: #allInstVars)
                 name: self allInstVarsTranslated; emphasizeName;
+                valueGetter: [:obj | obj longPrintString]; printValueAsIs;
-                valueGetter: [:object | object longPrintString]; printValueAsIs;
                 yourself!

Item was changed:
  ----- Method: Inspector>>fieldSelf (in category 'fields') -----
  fieldSelf

         ^ (self newFieldForType: #self key: #self)
                 name: 'self'; styleName: ((UserInterfaceTheme current get: #self for: #SHTextStylerST80) ifNil: [#()]);
+                valueGetter: [:obj | obj];
+                valueSetter: [:obj :value | self object: value]; "Switch to another object-under-inspection."
-                valueGetter: [:object | object];
-                valueSetter: [:object :value | self object: value]; "Switch to another object-under-inspection."
                 yourself!

Item was changed:
  ----- Method: Inspector>>streamInstanceVariablesOn: (in category 'fields - streaming') -----
  streamInstanceVariablesOn: aStream

         | attributesForInstVars |
         attributesForInstVars :=  (UserInterfaceTheme current get: #instVar for: #SHTextStylerST80) ifNil: [#()].

         (self object perform: #class "do not inline send of #class, receiver could be a proxy") allInstVarNames withIndexDo: [:name :index |
                 aStream nextPut: ((self newFieldForType: #instVar key: name)
                         name: name; styleName: attributesForInstVars;
+                        valueGetter: [:obj | obj instVarNamed: name];
+                        valueSetter: [:obj :value | obj instVarNamed: name put: value];
-                        valueGetter: [:object | object instVarNamed: name];
-                        valueSetter: [:object :value | object instVarNamed: name put: value];
                         yourself)].!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210908/8c714c11/attachment.html>


More information about the Squeak-dev mailing list