The Trunk: Kernel-mt.1283.mcz

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

The Trunk: Kernel-mt.1283.mcz

commits-2
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1283.mcz

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

Name: Kernel-mt.1283
Author: mt
Time: 27 November 2019, 10:25:51.203363 am
UUID: 04694a24-76a1-a941-b664-645ffc7f27e6
Ancestors: Kernel-nice.1282

Removes Kernel -> Regex dependency.

=============== Diff against Kernel-nice.1282 ===============

Item was changed:
  ----- Method: BlockClosure>>valueSupplyingAnswers: (in category 'evaluating') -----
  valueSupplyingAnswers: aListOfPairs
  "evaluate the block using a list of questions / answers that might be called upon to
  automatically respond to Object>>confirm: or FillInTheBlank requests"
 
  ^self
  on: ProvideAnswerNotification
  do: [ :notification |
  | caption |
  caption := notification messageText withSeparatorsCompacted. "to remove new lines"
  aListOfPairs
  detect:  [ :each |
  caption = each first
  or: [ (caption includesSubstring: each first caseSensitive: false)
  or: [ (each first match: caption)
  or: [ (caption respondsTo: #matchesRegex:)
+ and: [ [caption matchesRegex: each first] on: Error do: [false] ] ] ] ] ]
- and: [ [caption matchesRegex: each first] on: RegexSyntaxError do: [false] ] ] ] ] ]
  ifFound: [ :answer | notification resume: answer second ]
  ifNone: [
  (ProvideAnswerNotification signal: notification messageText)
  ifNil: [ notification resume ]
  ifNotNil: [ :outerAnswer | notification resume: outerAnswer ] ] ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-mt.1283.mcz

Christoph Thiede

Just curious: #matchesRegex: is defined in Regex-Core as well as RegexSyntaxError.

What are your goals to make changes like this?

In general, wouldn't generic error handling like this increase the risk of suppressing unexpected errors? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Mittwoch, 27. November 2019 10:25:56
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-mt.1283.mcz
 
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1283.mcz

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

Name: Kernel-mt.1283
Author: mt
Time: 27 November 2019, 10:25:51.203363 am
UUID: 04694a24-76a1-a941-b664-645ffc7f27e6
Ancestors: Kernel-nice.1282

Removes Kernel -> Regex dependency.

=============== Diff against Kernel-nice.1282 ===============

Item was changed:
  ----- Method: BlockClosure>>valueSupplyingAnswers: (in category 'evaluating') -----
  valueSupplyingAnswers: aListOfPairs
         "evaluate the block using a list of questions / answers that might be called upon to
         automatically respond to Object>>confirm: or FillInTheBlank requests"
 
         ^self
                 on: ProvideAnswerNotification
                 do: [ :notification |
                         | caption |
                         caption := notification messageText withSeparatorsCompacted. "to remove new lines"
                         aListOfPairs
                                 detect:  [ :each |
                                         caption = each first
                                                 or: [ (caption includesSubstring: each first caseSensitive: false)
                                                 or: [ (each first match: caption)
                                                 or: [ (caption respondsTo: #matchesRegex:)
+                                                        and: [ [caption matchesRegex: each first] on: Error do: [false] ] ] ] ] ]
-                                                        and: [ [caption matchesRegex: each first] on: RegexSyntaxError do: [false] ] ] ] ] ]
                                 ifFound: [ :answer | notification resume: answer second ]
                                 ifNone: [
                                         (ProvideAnswerNotification signal: notification messageText)
                                                 ifNil: [ notification resume ]
                                                 ifNotNil: [ :outerAnswer | notification resume: outerAnswer ] ] ]!




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

Re: The Trunk: Kernel-mt.1283.mcz

marcel.taeumel
What are your goals to make changes like this?

So close to a release, my goals are to not add new dependencies between packages.

In general, wouldn't generic error handling like this increase the risk of suppressing unexpected errors?

The very meaning of #valueSupplyingAnswers: is to suppress interactive stuff. Maybe we could add a Transcript output to log those errors. Also, this mechanism deserves to be re-designed. There is a lot of things going on in this method. We need better extension points for this and tests and ... :-)

Best,
Marcel

Am 07.12.2019 00:06:37 schrieb Thiede, Christoph <[hidden email]>:

Just curious: #matchesRegex: is defined in Regex-Core as well as RegexSyntaxError.

What are your goals to make changes like this?

In general, wouldn't generic error handling like this increase the risk of suppressing unexpected errors? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Mittwoch, 27. November 2019 10:25:56
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-mt.1283.mcz
 
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1283.mcz

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

Name: Kernel-mt.1283
Author: mt
Time: 27 November 2019, 10:25:51.203363 am
UUID: 04694a24-76a1-a941-b664-645ffc7f27e6
Ancestors: Kernel-nice.1282

Removes Kernel -> Regex dependency.

=============== Diff against Kernel-nice.1282 ===============

Item was changed:
  ----- Method: BlockClosure>>valueSupplyingAnswers: (in category 'evaluating') -----
  valueSupplyingAnswers: aListOfPairs
         "evaluate the block using a list of questions / answers that might be called upon to
         automatically respond to Object>>confirm: or FillInTheBlank requests"
 
         ^self
                 on: ProvideAnswerNotification
                 do: [ :notification |
                         | caption |
                         caption := notification messageText withSeparatorsCompacted. "to remove new lines"
                         aListOfPairs
                                 detect:  [ :each |
                                         caption = each first
                                                 or: [ (caption includesSubstring: each first caseSensitive: false)
                                                 or: [ (each first match: caption)
                                                 or: [ (caption respondsTo: #matchesRegex:)
+                                                        and: [ [caption matchesRegex: each first] on: Error do: [false] ] ] ] ] ]
-                                                        and: [ [caption matchesRegex: each first] on: RegexSyntaxError do: [false] ] ] ] ] ]
                                 ifFound: [ :answer | notification resume: answer second ]
                                 ifNone: [
                                         (ProvideAnswerNotification signal: notification messageText)
                                                 ifNil: [ notification resume ]
                                                 ifNotNil: [ :outerAnswer | notification resume: outerAnswer ] ] ]!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-mt.1283.mcz

Christoph Thiede

Thanks for the explanation :)


Logging uncritical errors instead of displaying them to the user? This does not sound like the loveable and always improvable system I have always known ;-)

If we decided to do something like this, I would rather suggest to raise a kind of warning that can be suppressed by uninterested users.



And just by the way, wouldn't the following be a valid refactoring? I cannot observe any difference :)




Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Sonntag, 8. Dezember 2019 16:23:29
An: John Pfersich via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: Kernel-mt.1283.mcz
 
What are your goals to make changes like this?

So close to a release, my goals are to not add new dependencies between packages.

In general, wouldn't generic error handling like this increase the risk of suppressing unexpected errors?

The very meaning of #valueSupplyingAnswers: is to suppress interactive stuff. Maybe we could add a Transcript output to log those errors. Also, this mechanism deserves to be re-designed. There is a lot of things going on in this method. We need better extension points for this and tests and ... :-)

Best,
Marcel

Am 07.12.2019 00:06:37 schrieb Thiede, Christoph <[hidden email]>:

Just curious: #matchesRegex: is defined in Regex-Core as well as RegexSyntaxError.

What are your goals to make changes like this?

In general, wouldn't generic error handling like this increase the risk of suppressing unexpected errors? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Mittwoch, 27. November 2019 10:25:56
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-mt.1283.mcz
 
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1283.mcz

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

Name: Kernel-mt.1283
Author: mt
Time: 27 November 2019, 10:25:51.203363 am
UUID: 04694a24-76a1-a941-b664-645ffc7f27e6
Ancestors: Kernel-nice.1282

Removes Kernel -> Regex dependency.

=============== Diff against Kernel-nice.1282 ===============

Item was changed:
  ----- Method: BlockClosure>>valueSupplyingAnswers: (in category 'evaluating') -----
  valueSupplyingAnswers: aListOfPairs
         "evaluate the block using a list of questions / answers that might be called upon to
         automatically respond to Object>>confirm: or FillInTheBlank requests"
 
         ^self
                 on: ProvideAnswerNotification
                 do: [ :notification |
                         | caption |
                         caption := notification messageText withSeparatorsCompacted. "to remove new lines"
                         aListOfPairs
                                 detect:  [ :each |
                                         caption = each first
                                                 or: [ (caption includesSubstring: each first caseSensitive: false)
                                                 or: [ (each first match: caption)
                                                 or: [ (caption respondsTo: #matchesRegex:)
+                                                        and: [ [caption matchesRegex: each first] on: Error do: [false] ] ] ] ] ]
-                                                        and: [ [caption matchesRegex: each first] on: RegexSyntaxError do: [false] ] ] ] ] ]
                                 ifFound: [ :answer | notification resume: answer second ]
                                 ifNone: [
                                         (ProvideAnswerNotification signal: notification messageText)
                                                 ifNil: [ notification resume ]
                                                 ifNotNil: [ :outerAnswer | notification resume: outerAnswer ] ] ]!




Carpe Squeak!