[squeak-dev] The Inbox: Tools-jr.972.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Jun 6 17:12:30 UTC 2020


Hi Jakob,


thanks for having a look at this, I already noticed this bug, too. The problem is, however, as stated in the comment that we need the #printString representation here which we also see in a regular inspector field. I already had a discussion about this with Marcel before this was committed to the Trunk.


This is how an empty string in the stackTop looks in the Trunk:

[cid:3ab13b8a-6673-4ccf-9a8f-98771a2d2ed4]


But with your change, it will look like this:

[cid:f41122ee-515b-465e-9899-9a761817e88e]


And then there would be no chance to distinguish this from an actually empty stack:

[cid:a20a6b4d-e19b-4e73-a9cb-c0a0d2b4bcd4]


The problem is that we are using #printValueAsIs here, without which it would look fine. However, if the stack is actually empty, we don't want to see "''" or "nil" but really nothing so we must use #printValueAsIs here.


I think we should add another block the InspectorFieldSpec and rewrite #fieldStackTop like this:


fieldStackTop

^ (self newFieldForType: #stackTop key: #stackTop)

    name: 'stack top' translated; emphasizeName;

    hasValue: [:object | object actualStackSize > 0];

    valueGetter: [:object | object top];

    expression: 'ThisContext top';

    yourself

I'm looking forward to your opinion :-)


Best,

Christoph


<http://www.hpi.de/>
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Samstag, 6. Juni 2020 18:29:15
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: Tools-jr.972.mcz

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.972.mcz

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

Name: Tools-jr.972
Author: jr
Time: 6 June 2020, 6:29:12.309632 pm
UUID: 2735b7ce-1f1b-a846-9635-f225f1db5be7
Ancestors: Tools-mt.970

Fix: inspecting the stack top only inspected its printString instead.

=============== Diff against Tools-mt.970 ===============

Item was changed:
  ----- Method: ContextVariablesInspector>>fieldStackTop (in category 'fields') -----
  fieldStackTop
         "Note that #valueGetter returns the actual printString to not confuse an empty stack top with nil or an empty string. So the value pane will just stay empty if there is no stack top and it will show 'nil' or '''' otherwise."

         ^ (self newFieldForType: #stackTop key: #stackTop)
                 name: 'stack top' translated; emphasizeName;
+                valueGetter: [:context | context actualStackSize > 0 ifTrue: [context top] ifFalse: ['']];
-                valueGetter: [:context | context actualStackSize > 0 ifTrue: [context top printString] ifFalse: ['']];
                 printValueAsIs;
                 valueGetterExpression: 'ThisContext top';
                 yourself!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200606/e25817be/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 31338 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200606/e25817be/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 30994 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200606/e25817be/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 37590 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200606/e25817be/attachment-0005.png>


More information about the Squeak-dev mailing list