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 ] ] ]! |
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
|
Hi Marcel,
> 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. I see ... Would you recommend to make extra commits to beautify any indentations? Or should we leave them "dirty" forever? :-)
By the way: Maybe Monticello's diffing could also benefit from an #ignoreWhitespace mode.
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 17. Februar 2020 10:48:08 An: Javier Diaz-Reinoso via Squeak-dev Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1299.mcz
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
Carpe Squeak!
|
> Or should we leave them "dirty" forever? :-) Since beauty in code formatting is often subjective, I would only change style if I would modify most parts of it. This was not the case here. There are many discussions about this topic on the mailing list. ;-) Best, Marcel
|
Free forum by Nabble | Edit this page |