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

Eliot Miranda eliot.miranda at gmail.com
Tue Jun 9 16:58:34 UTC 2020



> 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?

+1

> 
> 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>:
>> 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:
>> 
>> <pastedImage.png>
>> 
>> 
>> 
>> 
>> But with your change, it will look like this:
>> 
>> <pastedImage.png>
>> 
>> 
>> 
>> 
>> And then there would be no chance to distinguish this from an actually empty stack:
>> 
>> <pastedImage.png>
>> 
>> 
>> 
>> 
>> 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
>> 
>> 
>> 
>> 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/20200609/0f3595b3/attachment-0001.html>


More information about the Squeak-dev mailing list