[squeak-dev] The Inbox: Kernel-ct.1299.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Feb 17 09:48:08 UTC 2020


Hi Christoph,

thanks. Next time, you could try to not change the formatting too much when making two litttle changes to the code so that others can easily read the diff. In this case, the change of indentation affected all lines but was not necessary.

Best,
Marcel
Am 16.02.2020 16:26:54 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1299.mcz

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

Name: Kernel-ct.1299
Author: ct
Time: 16 February 2020, 4:26:42.224 pm
UUID: b1c9f40a-a7ea-9a4e-a502-268cb22592e7
Ancestors: Kernel-tonyg.1293

Refactor #valueSupplyingAnswers::

- Don't reinvent the wheel of Exception >> #pass
- Use #ifError:

See also http://forum.world.st/The-Trunk-Kernel-mt-1283-mcz-td5107403.html.

=============== Diff against Kernel-tonyg.1293 ===============

Item was changed:
----- Method: BlockClosure>>valueSupplyingAnswers: (in category 'evaluating') -----
valueSupplyingAnswers: aListOfPairs
+ "Evaluate the receiver using a list of questions / answers that might be called upon to automatically respond to Object>>confirm: or FillInTheBlank requests"
- "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] ifError: [false] ] ] ] ] ]
+ ifFound: [ :answer | notification resume: answer second ]
+ ifNone: [ notification pass ] ]!
- ^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] ] ] ] ] ]
- ifFound: [ :answer | notification resume: answer second ]
- ifNone: [
- (ProvideAnswerNotification signal: notification messageText)
- ifNil: [ notification resume ]
- ifNotNil: [ :outerAnswer | notification resume: outerAnswer ] ] ]!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200217/e41b84d6/attachment.html>


More information about the Squeak-dev mailing list