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

Marcel Taeumel marcel.taeumel at hpi.de
Tue Jun 9 17:38:36 UTC 2020

Okay. Tools-mt.974.

Am 09.06.2020 18:58:48 schrieb Eliot Miranda <eliot.miranda at gmail.com>:

On Jun 6, 2020, at 11:57 AM, Jakob Reschke <forums.jakob at resfarm.de> wrote:

Is it out of the question to just not show the "stack top" field at all when there is no top of the stack to be shown?


Unless we find a proper solution, I'd rather accept the oddity with empty strings than not ever being able to inspect what is on the top of the stack.

Am Sa., 6. Juni 2020 um 19:12 Uhr schrieb Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de [mailto:Christoph.Thiede at student.hpi.uni-potsdam.de]>:

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:

But with your change, it will look like this:

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

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:

^ (self newFieldForType: #stackTop key: #stackTop)
    name: 'stack top' translated; emphasizeName;
    hasValue: [:object | object actualStackSize > 0];
    valueGetter: [:object | object top];
    expression: 'ThisContext top';

I'm looking forward to your opinion :-)


Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-bounces at lists.squeakfoundation.org]> im Auftrag von commits at source.squeak.org [mailto:commits at source.squeak.org] <commits at source.squeak.org [mailto:commits at source.squeak.org]>
Gesendet: Samstag, 6. Juni 2020 18:29:15
An: squeak-dev at lists.squeakfoundation.org [mailto: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 [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') -----
         "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: ['']];
                 valueGetterExpression: 'ThisContext top';

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200609/02822cc5/attachment.html>

More information about the Squeak-dev mailing list