[squeak-dev] The Trunk: Kernel-mt.1281.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Nov 22 14:39:51 UTC 2019


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

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

Name: Kernel-mt.1281
Author: mt
Time: 22 November 2019, 3:39:45.714669 pm
UUID: 08eab339-2d37-7d41-ab09-6776ddbb09b0
Ancestors: Kernel-mt.1280, Kernel-ct.1270, Kernel-ct.1278

Merges Kernel-ct.1270, Kernel-ct.1278:
- better print-string for Complex
- bugfix in #valueSupplyingAnswers: for bad regex expressions

=============== Diff against Kernel-mt.1280 ===============

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: RegexSyntaxError do: [false] ] ] ] ] ]
- 							and: [ caption matchesRegex: each first ] ] ] ] ]
  				ifFound: [ :answer | notification resume: answer second ]
  				ifNone: [
  					(ProvideAnswerNotification signal: notification messageText)
  						ifNil: [ notification resume ]
  						ifNotNil: [ :outerAnswer | notification resume: outerAnswer ] ] ]!

Item was added:
+ ----- Method: Complex>>printOn:showingDecimalPlaces: (in category 'printing') -----
+ printOn: aStream showingDecimalPlaces: placesDesired
+ 	real printOn: aStream showingDecimalPlaces: placesDesired.
+ 	aStream nextPut: Character space.
+ 	0 <= imaginary
+ 		ifTrue: [aStream nextPut: $+]
+ 		ifFalse: [aStream nextPut: $-].
+ 	aStream nextPut: Character space.
+ 	imaginary abs printOn: aStream showingDecimalPlaces: placesDesired.
+ 	aStream nextPut: Character space.
+ 	aStream nextPut: $i
+ !

Item was added:
+ ----- Method: Complex>>stringForReadout (in category 'printing') -----
+ stringForReadout
+ 
+ 	^ String streamContents: [:stream |
+ 		self printOn: stream showingDecimalPlaces: 0]!



More information about the Squeak-dev mailing list