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 ] ] ]!
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Mittwoch, 27. November 2019 10:25:56 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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 ] ] ]!
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 christoph.thiede@student.hpi.uni-potsdam.de: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Mittwoch, 27. November 2019 10:25:56 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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 [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 ] ] ]!
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 :)
[cid:3b1985f4-c21f-4425-8a07-5bbda666686a]
Best,
Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Sonntag, 8. Dezember 2019 16:23:29 An: John Pfersich via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de:
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Mittwoch, 27. November 2019 10:25:56 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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 ] ] ]!
squeak-dev@lists.squeakfoundation.org