The Inbox: Morphic-ct.1590.mcz

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

The Inbox: Morphic-ct.1590.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1590.mcz

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

Name: Morphic-ct.1590
Author: ct
Time: 15 November 2019, 7:55:13.975005 pm
UUID: 1f877d26-b019-fb45-9020-7c902b002b46
Ancestors: Morphic-mt.1588

Add "debug accept action" into debug menu of PluggableTextMorph. Furthermore, refactor all "debug action" code in this package by using ToolSet>>#debugBlock:runUntilMethod:withTitle:.

Complements System-ct.1121.

=============== Diff against Morphic-mt.1588 ===============

Item was added:
+ ----- Method: MenuItemMorph>>actionMethod (in category 'browse') -----
+ actionMethod
+
+ ^ (target class lookupSelector: selector) methodReference!

Item was changed:
  ----- Method: MenuItemMorph>>browseImplementationOfActionSelector (in category 'browse') -----
  browseImplementationOfActionSelector
 
+ ^ self actionMethod browse!
- | method |
- method := target class lookupSelector: selector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
  ----- Method: MenuItemMorph>>debugAction (in category 'browse') -----
  debugAction
 
+ ^ ToolSet
+ debugBlock: [self doButtonAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString})!
- (Process
- forBlock: [self doButtonAction]
- runUntil: [:context | context selector = self selector])
- debugWithTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString}).!

Item was added:
+ ----- Method: PluggableButtonMorph>>actionMethod (in category 'debug menu') -----
+ actionMethod
+
+ ^ (model class lookupSelector: actionSelector) methodReference!

Item was changed:
  ----- Method: PluggableButtonMorph>>browseImplementationOfActionSelector (in category 'debug menu') -----
  browseImplementationOfActionSelector
 
+ ^ self actionMethod browse!
- | method |
- method := model class lookupSelector: actionSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
  ----- Method: PluggableButtonMorph>>debugAction (in category 'debug menu') -----
  debugAction
 
+ ^ ToolSet
+ debugBlock: [self performAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString})!
- (Process
- forBlock: [self performAction]
- runUntil: [:context | context selector = self actionSelector])
- debugWithTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString}).!

Item was changed:
  ----- Method: PluggableListMorph>>browseImplementationOfGetListSelector (in category 'debug and other') -----
  browseImplementationOfGetListSelector
 
+ ^ self getListMethod browse!
- | method |
- method := model class lookupSelector: getListSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
  ----- Method: PluggableListMorph>>debugGetList (in category 'debug and other') -----
  debugGetList
 
+ ^ ToolSet
+ debugBlock: [model perform: getListSelector]
+ runUntilMethod: self getListMethod
+ withTitle: ('Debug get-list invocation in model "{1}"' format: {model printString})!
- (Process
- forBlock: [model perform: getListSelector]
- runUntil: [:context | context selector = getListSelector])
- debugWithTitle: ('Debug get-list invocation in model "{1}"' format: {model printString}).!

Item was added:
+ ----- Method: PluggableListMorph>>getListMethod (in category 'debug and other') -----
+ getListMethod
+
+ ^ (self model class lookupSelector: self getListSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>acceptMethod (in category 'debug and other') -----
+ acceptMethod
+
+ ^ (self model class lookupSelector: self setTextSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>browseImplementationOfAcceptSelector (in category 'debug and other') -----
+ browseImplementationOfAcceptSelector
+
+ ^ self acceptMethod browse!

Item was added:
+ ----- Method: PluggableTextMorph>>buildDebugMenu: (in category 'debug and other') -----
+ buildDebugMenu: aHandMorph
+
+ | aMenu |
+ aMenu := super buildDebugMenu: aHandMorph.
+ aMenu addLine.
+ aMenu add: 'browse accept action' translated target: self action: #browseImplementationOfAcceptSelector.
+ aMenu add: 'debug accept action' translated target: self action: #debugAccept.
+ ^ aMenu!

Item was added:
+ ----- Method: PluggableTextMorph>>debugAccept (in category 'debug and other') -----
+ debugAccept
+
+ ^ ToolSet
+ debugBlock: [self acceptTextInModel]
+ runUntilMethod: self acceptMethod
+ withTitle: ('Debug accept action in model "{1}"' format: {self model})!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1590.mcz

marcel.taeumel
Hi, Christoph.

-1 for the refactoring of all "debug action". 

The use of ToolSet here feels less object-oriented than working with an actual process object, which is easy to create.

Also, #debugWithTitle: ends up nicely in ToolSet already. No benefit in expanding the interface of ToolSet any further for this scenario.

Best,
Marcel

Am 15.11.2019 19:55:36 schrieb [hidden email] <[hidden email]>:

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1590.mcz

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

Name: Morphic-ct.1590
Author: ct
Time: 15 November 2019, 7:55:13.975005 pm
UUID: 1f877d26-b019-fb45-9020-7c902b002b46
Ancestors: Morphic-mt.1588

Add "debug accept action" into debug menu of PluggableTextMorph. Furthermore, refactor all "debug action" code in this package by using ToolSet>>#debugBlock:runUntilMethod:withTitle:.

Complements System-ct.1121.

=============== Diff against Morphic-mt.1588 ===============

Item was added:
+ ----- Method: MenuItemMorph>>actionMethod (in category 'browse') -----
+ actionMethod
+
+ ^ (target class lookupSelector: selector) methodReference!

Item was changed:
----- Method: MenuItemMorph>>browseImplementationOfActionSelector (in category 'browse') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := target class lookupSelector: selector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: MenuItemMorph>>debugAction (in category 'browse') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self doButtonAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString})!
- (Process
- forBlock: [self doButtonAction]
- runUntil: [:context | context selector = self selector])
- debugWithTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString}).!

Item was added:
+ ----- Method: PluggableButtonMorph>>actionMethod (in category 'debug menu') -----
+ actionMethod
+
+ ^ (model class lookupSelector: actionSelector) methodReference!

Item was changed:
----- Method: PluggableButtonMorph>>browseImplementationOfActionSelector (in category 'debug menu') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := model class lookupSelector: actionSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableButtonMorph>>debugAction (in category 'debug menu') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self performAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString})!
- (Process
- forBlock: [self performAction]
- runUntil: [:context | context selector = self actionSelector])
- debugWithTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString}).!

Item was changed:
----- Method: PluggableListMorph>>browseImplementationOfGetListSelector (in category 'debug and other') -----
browseImplementationOfGetListSelector

+ ^ self getListMethod browse!
- | method |
- method := model class lookupSelector: getListSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableListMorph>>debugGetList (in category 'debug and other') -----
debugGetList

+ ^ ToolSet
+ debugBlock: [model perform: getListSelector]
+ runUntilMethod: self getListMethod
+ withTitle: ('Debug get-list invocation in model "{1}"' format: {model printString})!
- (Process
- forBlock: [model perform: getListSelector]
- runUntil: [:context | context selector = getListSelector])
- debugWithTitle: ('Debug get-list invocation in model "{1}"' format: {model printString}).!

Item was added:
+ ----- Method: PluggableListMorph>>getListMethod (in category 'debug and other') -----
+ getListMethod
+
+ ^ (self model class lookupSelector: self getListSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>acceptMethod (in category 'debug and other') -----
+ acceptMethod
+
+ ^ (self model class lookupSelector: self setTextSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>browseImplementationOfAcceptSelector (in category 'debug and other') -----
+ browseImplementationOfAcceptSelector
+
+ ^ self acceptMethod browse!

Item was added:
+ ----- Method: PluggableTextMorph>>buildDebugMenu: (in category 'debug and other') -----
+ buildDebugMenu: aHandMorph
+
+ | aMenu |
+ aMenu := super buildDebugMenu: aHandMorph.
+ aMenu addLine.
+ aMenu add: 'browse accept action' translated target: self action: #browseImplementationOfAcceptSelector.
+ aMenu add: 'debug accept action' translated target: self action: #debugAccept.
+ ^ aMenu!

Item was added:
+ ----- Method: PluggableTextMorph>>debugAccept (in category 'debug and other') -----
+ debugAccept
+
+ ^ ToolSet
+ debugBlock: [self acceptTextInModel]
+ runUntilMethod: self acceptMethod
+ withTitle: ('Debug accept action in model "{1}"' format: {self model})!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1590.mcz

Christoph Thiede

Hi Marcel,


Thank you for the explanation, I see my mistake. Would you still consider some method such as Process>>#runUntilMethod: or #runUntilClass:selector:? I think that only checking the selector is not really the desired behavior here, is it?


And even though this is a very minor point, I do not really like the "triangle layout" of these debug methods. Wouldn't the following variant provide a better rectangular layout? Just curious how patterns are applied here the best way :-)




Aside from this, would you like me to upload the "debug accept action" again in a separate commit or is this easier to do for the merger? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 18. November 2019 09:28:23
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1590.mcz
 
Hi, Christoph.

-1 for the refactoring of all "debug action". 

The use of ToolSet here feels less object-oriented than working with an actual process object, which is easy to create.

Also, #debugWithTitle: ends up nicely in ToolSet already. No benefit in expanding the interface of ToolSet any further for this scenario.

Best,
Marcel

Am 15.11.2019 19:55:36 schrieb [hidden email] <[hidden email]>:

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1590.mcz

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

Name: Morphic-ct.1590
Author: ct
Time: 15 November 2019, 7:55:13.975005 pm
UUID: 1f877d26-b019-fb45-9020-7c902b002b46
Ancestors: Morphic-mt.1588

Add "debug accept action" into debug menu of PluggableTextMorph. Furthermore, refactor all "debug action" code in this package by using ToolSet>>#debugBlock:runUntilMethod:withTitle:.

Complements System-ct.1121.

=============== Diff against Morphic-mt.1588 ===============

Item was added:
+ ----- Method: MenuItemMorph>>actionMethod (in category 'browse') -----
+ actionMethod
+
+ ^ (target class lookupSelector: selector) methodReference!

Item was changed:
----- Method: MenuItemMorph>>browseImplementationOfActionSelector (in category 'browse') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := target class lookupSelector: selector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: MenuItemMorph>>debugAction (in category 'browse') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self doButtonAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString})!
- (Process
- forBlock: [self doButtonAction]
- runUntil: [:context | context selector = self selector])
- debugWithTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString}).!

Item was added:
+ ----- Method: PluggableButtonMorph>>actionMethod (in category 'debug menu') -----
+ actionMethod
+
+ ^ (model class lookupSelector: actionSelector) methodReference!

Item was changed:
----- Method: PluggableButtonMorph>>browseImplementationOfActionSelector (in category 'debug menu') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := model class lookupSelector: actionSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableButtonMorph>>debugAction (in category 'debug menu') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self performAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString})!
- (Process
- forBlock: [self performAction]
- runUntil: [:context | context selector = self actionSelector])
- debugWithTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString}).!

Item was changed:
----- Method: PluggableListMorph>>browseImplementationOfGetListSelector (in category 'debug and other') -----
browseImplementationOfGetListSelector

+ ^ self getListMethod browse!
- | method |
- method := model class lookupSelector: getListSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableListMorph>>debugGetList (in category 'debug and other') -----
debugGetList

+ ^ ToolSet
+ debugBlock: [model perform: getListSelector]
+ runUntilMethod: self getListMethod
+ withTitle: ('Debug get-list invocation in model "{1}"' format: {model printString})!
- (Process
- forBlock: [model perform: getListSelector]
- runUntil: [:context | context selector = getListSelector])
- debugWithTitle: ('Debug get-list invocation in model "{1}"' format: {model printString}).!

Item was added:
+ ----- Method: PluggableListMorph>>getListMethod (in category 'debug and other') -----
+ getListMethod
+
+ ^ (self model class lookupSelector: self getListSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>acceptMethod (in category 'debug and other') -----
+ acceptMethod
+
+ ^ (self model class lookupSelector: self setTextSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>browseImplementationOfAcceptSelector (in category 'debug and other') -----
+ browseImplementationOfAcceptSelector
+
+ ^ self acceptMethod browse!

Item was added:
+ ----- Method: PluggableTextMorph>>buildDebugMenu: (in category 'debug and other') -----
+ buildDebugMenu: aHandMorph
+
+ | aMenu |
+ aMenu := super buildDebugMenu: aHandMorph.
+ aMenu addLine.
+ aMenu add: 'browse accept action' translated target: self action: #browseImplementationOfAcceptSelector.
+ aMenu add: 'debug accept action' translated target: self action: #debugAccept.
+ ^ aMenu!

Item was added:
+ ----- Method: PluggableTextMorph>>debugAccept (in category 'debug and other') -----
+ debugAccept
+
+ ^ ToolSet
+ debugBlock: [self acceptTextInModel]
+ runUntilMethod: self acceptMethod
+ withTitle: ('Debug accept action in model "{1}"' format: {self model})!





pastedImage.png (97K) Download Attachment
pastedImage.png (99K) Download Attachment
Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1590.mcz

marcel.taeumel
Hi, Christoph.

Would you still consider some method such as Process>>#runUntilMethod: or #runUntilClass:selector:?

What would you want to check there? The exact instance of the CompieldMethod? Would the a superclass be also okay for "...Class:selector"? It's not that obvious. Better make it explicit at the caller site.

-1 for both #runUntilMethod: or #runUntilClass:selector:-)

I think that only checking the selector is not really the desired behavior here, is it?

Check for the correct receiver, if you want to. But do not hide it in some class-side method in Process. ;-) Maybe (!) Process class >> #runUntilSend: aMessageSend. Still, I am not so sure that a "send" in Process is regarded as the same as the MessageSend (class).

> ... I do not really like the "triangle layout" of these debug methods ...
> ... a better rectangular layout ...

Not sure what you mean by that. Browse the squeak-dev mailing list to get some impression on how people think about code formatting in general. I suppose it is a touchy subject. In this case, I do not personally care. :-) Just avoid changing methods for the sake of reformatting them only. Try also to watch out for the "surrounding" (method scope, class scope, package scope) code format. Try to respect it. ;-)

Best,
Marcel

Am 18.11.2019 12:01:14 schrieb Thiede, Christoph <[hidden email]>:

Hi Marcel,


Thank you for the explanation, I see my mistake. Would you still consider some method such as Process>>#runUntilMethod: or #runUntilClass:selector:? I think that only checking the selector is not really the desired behavior here, is it?


And even though this is a very minor point, I do not really like the "triangle layout" of these debug methods. Wouldn't the following variant provide a better rectangular layout? Just curious how patterns are applied here the best way :-)




Aside from this, would you like me to upload the "debug accept action" again in a separate commit or is this easier to do for the merger? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 18. November 2019 09:28:23
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1590.mcz
 
Hi, Christoph.

-1 for the refactoring of all "debug action". 

The use of ToolSet here feels less object-oriented than working with an actual process object, which is easy to create.

Also, #debugWithTitle: ends up nicely in ToolSet already. No benefit in expanding the interface of ToolSet any further for this scenario.

Best,
Marcel

Am 15.11.2019 19:55:36 schrieb [hidden email] <[hidden email]>:

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1590.mcz

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

Name: Morphic-ct.1590
Author: ct
Time: 15 November 2019, 7:55:13.975005 pm
UUID: 1f877d26-b019-fb45-9020-7c902b002b46
Ancestors: Morphic-mt.1588

Add "debug accept action" into debug menu of PluggableTextMorph. Furthermore, refactor all "debug action" code in this package by using ToolSet>>#debugBlock:runUntilMethod:withTitle:.

Complements System-ct.1121.

=============== Diff against Morphic-mt.1588 ===============

Item was added:
+ ----- Method: MenuItemMorph>>actionMethod (in category 'browse') -----
+ actionMethod
+
+ ^ (target class lookupSelector: selector) methodReference!

Item was changed:
----- Method: MenuItemMorph>>browseImplementationOfActionSelector (in category 'browse') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := target class lookupSelector: selector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: MenuItemMorph>>debugAction (in category 'browse') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self doButtonAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString})!
- (Process
- forBlock: [self doButtonAction]
- runUntil: [:context | context selector = self selector])
- debugWithTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString}).!

Item was added:
+ ----- Method: PluggableButtonMorph>>actionMethod (in category 'debug menu') -----
+ actionMethod
+
+ ^ (model class lookupSelector: actionSelector) methodReference!

Item was changed:
----- Method: PluggableButtonMorph>>browseImplementationOfActionSelector (in category 'debug menu') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := model class lookupSelector: actionSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableButtonMorph>>debugAction (in category 'debug menu') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self performAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString})!
- (Process
- forBlock: [self performAction]
- runUntil: [:context | context selector = self actionSelector])
- debugWithTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString}).!

Item was changed:
----- Method: PluggableListMorph>>browseImplementationOfGetListSelector (in category 'debug and other') -----
browseImplementationOfGetListSelector

+ ^ self getListMethod browse!
- | method |
- method := model class lookupSelector: getListSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableListMorph>>debugGetList (in category 'debug and other') -----
debugGetList

+ ^ ToolSet
+ debugBlock: [model perform: getListSelector]
+ runUntilMethod: self getListMethod
+ withTitle: ('Debug get-list invocation in model "{1}"' format: {model printString})!
- (Process
- forBlock: [model perform: getListSelector]
- runUntil: [:context | context selector = getListSelector])
- debugWithTitle: ('Debug get-list invocation in model "{1}"' format: {model printString}).!

Item was added:
+ ----- Method: PluggableListMorph>>getListMethod (in category 'debug and other') -----
+ getListMethod
+
+ ^ (self model class lookupSelector: self getListSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>acceptMethod (in category 'debug and other') -----
+ acceptMethod
+
+ ^ (self model class lookupSelector: self setTextSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>browseImplementationOfAcceptSelector (in category 'debug and other') -----
+ browseImplementationOfAcceptSelector
+
+ ^ self acceptMethod browse!

Item was added:
+ ----- Method: PluggableTextMorph>>buildDebugMenu: (in category 'debug and other') -----
+ buildDebugMenu: aHandMorph
+
+ | aMenu |
+ aMenu := super buildDebugMenu: aHandMorph.
+ aMenu addLine.
+ aMenu add: 'browse accept action' translated target: self action: #browseImplementationOfAcceptSelector.
+ aMenu add: 'debug accept action' translated target: self action: #debugAccept.
+ ^ aMenu!

Item was added:
+ ----- Method: PluggableTextMorph>>debugAccept (in category 'debug and other') -----
+ debugAccept
+
+ ^ ToolSet
+ debugBlock: [self acceptTextInModel]
+ runUntilMethod: self acceptMethod
+ withTitle: ('Debug accept action in model "{1}"' format: {self model})!