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! |
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:
Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Samstag, 6. Juni 2020 18:29:15 An: [hidden email] 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!
Carpe Squeak!
|
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 <[hidden email]>:
|
In reply to this post by commits-2
Hi Jakob, such a fix should address the comment in the method which states why it was that way. :o) You can do-it "ThisContext top inspect" to inspect the object on stack top. Best, Marcel
|
Hi Jakob, does Tools-mt.973 (in Trunk) work for you? Best, Marcel
|
In reply to this post by Jakob Reschke
On Jun 6, 2020, at 11:57 AM, Jakob Reschke <[hidden email]> wrote:
|
Okay. Tools-mt.974. Best, Marcel
|
Free forum by Nabble | Edit this page |