The Inbox: Tools-cmm.927.mcz

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

The Inbox: Tools-cmm.927.mcz

commits-2
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
  "Recalculate the KeyArray from the object being inspected"
+ keyArray := object isInitialized
+ ifTrue: [ object keysInOrder ]
+ ifFalse: [ Array empty ].
+ selectionIndex := 0!
-
- keyArray := object keysSortedSafely asArray.
- selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+ ^ array notNil and: [ tally notNil ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

Chris Muller-3
This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

marcel.taeumel
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

Nicolas Cellier
Hi Marcel,
Chris was wanting to step into "constructor" Dictionary new: 4

Le mer. 18 déc. 2019 à 10:02, Marcel Taeumel <[hidden email]> a écrit :
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!





Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

marcel.taeumel
Hmm... #isInitialized feels like an anti pattern that violates the basic "information hiding" principle... Could we rename it to make the special tool use more clear? Maybe #canBeUsedInInspector ?

Best,
Marcel

Am 18.12.2019 10:06:54 schrieb Nicolas Cellier <[hidden email]>:

Hi Marcel,
Chris was wanting to step into "constructor" Dictionary new: 4

Le mer. 18 déc. 2019 à 10:02, Marcel Taeumel <[hidden email]> a écrit :
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!





Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

Christoph Thiede

Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

Ideally, we could use a similar solution to #errorPrintString and display a short red note if the "keys could not be displayed." Imho, this would also a more accurate representation than faking an empty list when there is actually no list at all.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 19. Dezember 2019 13:50:39
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Tools-cmm.927.mcz
 
Hmm... #isInitialized feels like an anti pattern that violates the basic "information hiding" principle... Could we rename it to make the special tool use more clear? Maybe #canBeUsedInInspector ?

Best,
Marcel

Am 18.12.2019 10:06:54 schrieb Nicolas Cellier <[hidden email]>:

Hi Marcel,
Chris was wanting to step into "constructor" Dictionary new: 4

Le mer. 18 déc. 2019 à 10:02, Marcel Taeumel <[hidden email]> a écrit :
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!





Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

marcel.taeumel
Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

+1 That's the way to go in debugging tools that handle fragile objects. See ObjectExplorerWrapper >> #asString.

Best,
Marcel

Am 19.12.2019 15:28:24 schrieb Thiede, Christoph <[hidden email]>:

Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

Ideally, we could use a similar solution to #errorPrintString and display a short red note if the "keys could not be displayed." Imho, this would also a more accurate representation than faking an empty list when there is actually no list at all.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 19. Dezember 2019 13:50:39
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Tools-cmm.927.mcz
 
Hmm... #isInitialized feels like an anti pattern that violates the basic "information hiding" principle... Could we rename it to make the special tool use more clear? Maybe #canBeUsedInInspector ?

Best,
Marcel

Am 18.12.2019 10:06:54 schrieb Nicolas Cellier <[hidden email]>:

Hi Marcel,
Chris was wanting to step into "constructor" Dictionary new: 4

Le mer. 18 déc. 2019 à 10:02, Marcel Taeumel <[hidden email]> a écrit :
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!





Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

Chris Muller-3
On Fri, Dec 20, 2019 at 6:36 AM Marcel Taeumel <[hidden email]> wrote:
Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

+1

I agree ONLY because of your qualifier: 
 
That's the way to go in debugging tools that handle fragile objects. See ObjectExplorerWrapper >> #asString.

:)  Otherwise, I would consider it a bad idea... 

I'll submit another.

 - Chris


 

Best,
Marcel

Am 19.12.2019 15:28:24 schrieb Thiede, Christoph <[hidden email]>:

Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

Ideally, we could use a similar solution to #errorPrintString and display a short red note if the "keys could not be displayed." Imho, this would also a more accurate representation than faking an empty list when there is actually no list at all.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 19. Dezember 2019 13:50:39
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Tools-cmm.927.mcz
 
Hmm... #isInitialized feels like an anti pattern that violates the basic "information hiding" principle... Could we rename it to make the special tool use more clear? Maybe #canBeUsedInInspector ?

Best,
Marcel

Am 18.12.2019 10:06:54 schrieb Nicolas Cellier <[hidden email]>:

Hi Marcel,
Chris was wanting to step into "constructor" Dictionary new: 4

Le mer. 18 déc. 2019 à 10:02, Marcel Taeumel <[hidden email]> a écrit :
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!






Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

marcel.taeumel
:)  Otherwise, I would consider it a bad idea... 

Yeah, that on-error-do stuff should only be used carefully and rarely. I think there are other cases in our tools where such error handling is employed. Good for robustness as long as we can come up with a fallback like your empty array.

Note that this is not the same is an #ifNil-check :-) Which I consider a bad idea also in tool land... :-)

Best,
Marcel

Am 21.12.2019 00:55:23 schrieb Chris Muller <[hidden email]>:

On Fri, Dec 20, 2019 at 6:36 AM Marcel Taeumel <[hidden email]> wrote:
Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

+1

I agree ONLY because of your qualifier: 
 
That's the way to go in debugging tools that handle fragile objects. See ObjectExplorerWrapper >> #asString.

:)  Otherwise, I would consider it a bad idea... 

I'll submit another.

 - Chris


 

Best,
Marcel

Am 19.12.2019 15:28:24 schrieb Thiede, Christoph <[hidden email]>:

Why not just use #ifError: in #calculateKeyArray? Shouldn't inspectors/debuggers be robust in any way?

Ideally, we could use a similar solution to #errorPrintString and display a short red note if the "keys could not be displayed." Imho, this would also a more accurate representation than faking an empty list when there is actually no list at all.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 19. Dezember 2019 13:50:39
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Tools-cmm.927.mcz
 
Hmm... #isInitialized feels like an anti pattern that violates the basic "information hiding" principle... Could we rename it to make the special tool use more clear? Maybe #canBeUsedInInspector ?

Best,
Marcel

Am 18.12.2019 10:06:54 schrieb Nicolas Cellier <[hidden email]>:

Hi Marcel,
Chris was wanting to step into "constructor" Dictionary new: 4

Le mer. 18 déc. 2019 à 10:02, Marcel Taeumel <[hidden email]> a écrit :
Hi Chris,

I don't think that #isInitialized is necessary. Under which circumstances is a Dictionary or Set not initialized?

Best,
Marcel

Am 17.12.2019 23:15:49 schrieb Chris Muller <[hidden email]>:

This one removes the send to #asArray, it wasn't necessary.

On Tue, Dec 17, 2019 at 4:14 PM <[hidden email]> wrote:
Chris Muller uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cmm.927.mcz

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

Name: Tools-cmm.927
Author: cmm
Time: 17 December 2019, 4:14:11.72576 pm
UUID: 02595c45-7a56-4481-9038-3bca791d316e
Ancestors: Tools-mt.925

- Fix debugging of the initialization of Dictionary's.
- Fix the order of entries rendered by inspectors of OrderedDictionary's.

=============== Diff against Tools-mt.925 ===============

Item was changed:
  ----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
  calculateKeyArray
        "Recalculate the KeyArray from the object being inspected"
+       keyArray := object isInitialized
+               ifTrue: [ object keysInOrder ]
+               ifFalse: [ Array empty ].
+       selectionIndex := 0!
-
-       keyArray := object keysSortedSafely asArray.
-       selectionIndex := 0.
- !

Item was added:
+ ----- Method: HashedCollection>>isInitialized (in category '*Tools-Debugger') -----
+ isInitialized
+       ^ array notNil and: [ tally notNil ]!






Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-cmm.927.mcz

timrowledge
There's an old saying familiar to us Ancient Ones - "don't handle errors you can't actually handle".
One of the great classics of the genre was the Windows error  that used to happen so frequently it was beyond a joke; the "attempt to execute an illegal instruction" error window had the hilarious option to just continue.

> On 2019-12-22, at 6:22 AM, Marcel Taeumel <[hidden email]> wrote:
>
> > :)  Otherwise, I would consider it a bad idea...
>
> Yeah, that on-error-do stuff should only be used carefully and rarely. I think there are other cases in our tools where such error handling is employed. Good for robustness as long as we can come up with a fallback like your empty array.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Cloister: a pretentious clam