The Inbox: Tools-jr.972.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Tools-jr.972.mcz

commits-2
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!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.972.mcz

Christoph Thiede

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:


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 <[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!
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.972.mcz

Jakob Reschke
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]>:

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:


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 <[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!





Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.972.mcz

marcel.taeumel
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

Am 06.06.2020 18:29:23 schrieb [hidden email] <[hidden email]>:

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!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.972.mcz

marcel.taeumel
Hi Jakob,

does Tools-mt.973 (in Trunk) work for you? 

Best,
Marcel

Am 09.06.2020 16:07:14 schrieb Marcel Taeumel <[hidden email]>:

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

Am 06.06.2020 18:29:23 schrieb [hidden email] <[hidden email]>:

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!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.972.mcz

Eliot Miranda-2
In reply to this post by Jakob Reschke


On Jun 6, 2020, at 11:57 AM, Jakob Reschke <[hidden email]> 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 <[hidden email]>:

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 <[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!






Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.972.mcz

marcel.taeumel
Okay. Tools-mt.974.

Best,
Marcel

Am 09.06.2020 18:58:48 schrieb Eliot Miranda <[hidden email]>:



On Jun 6, 2020, at 11:57 AM, Jakob Reschke <[hidden email]> 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 <[hidden email]>:

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 <[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!