Marcel Taeumel uploaded a new version of ReleaseBuilder to project The Trunk:
http://source.squeak.org/trunk/ReleaseBuilder-mt.195.mcz
==================== Summary ====================
Name: ReleaseBuilder-mt.195
Author: mt
Time: 24 April 2019, 11:21:01.001118 am
UUID: 142779d1-084c-6643-b5ec-e665c0d7cfb0
Ancestors: ReleaseBuilder-mt.194
Fixes a minor issue in the release builder where deferred tasks and next tasks were mutually exclusive but should not.
WHY? The newest (CI) Trunk images did not show the welcome window and preference wizard.
=============== Diff against ReleaseBuilder-mt.194 ===============
Item was changed:
----- Method: ReleaseBuilder class>>startUp: (in category 'class initialization') -----
startUp: resuming
resuming
+ ifTrue: [DeferredTask ifNotNil: [:task | DeferredTask := nil. task value]]
+ ifFalse: [NextTask ifNotNil: [:task | NextTask := nil. task value]].!
- ifTrue: [NextTask := nil. DeferredTask ifNotNil: [:task | DeferredTask := nil. task value]]
- ifFalse: [DeferredTask := nil. NextTask ifNotNil: [:task | NextTask := nil. task value]].!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1485.mcz
==================== Summary ====================
Name: Morphic-mt.1485
Author: mt
Time: 24 April 2019, 11:10:53.74187 am
UUID: ddfc0442-d803-f04f-9267-a248ef94916e
Ancestors: Morphic-cmm.1484
Fixes a minor update/performance issue in SketchMorph, which affects the buttons of system windows.
I *think* it is never a good idea to overwrite #layoutChanged with such side effects. There are other examples in the code base. We should refactor that in the (near) future.
WHY? The message #layoutChanged should mean "Hey! My bounds have changed. Consider this in the next layout computation." It should not *do* the actual change but only tell others about it *after* it has happened.
=============== Diff against Morphic-cmm.1484 ===============
Item was changed:
----- Method: SketchMorph>>layoutChanged (in category 'layout') -----
layoutChanged
"Update rotatedForm and compute new bounds."
+
+ | priorBounds |
+ fullBounds ifNotNil: [self changed].
+
+ priorBounds := bounds.
+
+ self flag: #refactor. "mt: Such side-effects in #layoutChanged can have a severe impact on performance. Better not overwrite it but manage the rotatedForm elsewhere and from there call #layoutChanged if bounds change. Also, just overwrite #extent to use the extent of the rotated form."
- self changed.
self generateRotatedForm.
bounds := bounds origin extent: rotatedForm extent.
+
+ priorBounds ~= bounds
+ ifTrue: [super layoutChanged].
+
- super layoutChanged.
self changed.
!
Chris Muller uploaded a new version of SMLoader to project The Trunk:
http://source.squeak.org/trunk/SMLoader-cmm.93.mcz
==================== Summary ====================
Name: SMLoader-cmm.93
Author: cmm
Time: 12 November 2018, 9:32:37.990598 pm
UUID: f8100409-b6fa-45f5-ad2a-acc81a6f614a
Ancestors: SMLoader-cmm.91
- Allow releases which are not necessarily published to be selected when the UI selection was at the package level.
- Fix the problem of Release scripts seemingly not updating, due to not refreshing the local cache after uploading the script to the server.
=============== Diff against SMLoader-cmm.91 ===============
Item was changed:
----- Method: SMLoader>>installPackageRelease (in category 'actions') -----
installPackageRelease
"Install selected package or release.
The cache is used."
| item release |
item := self selectedPackageOrRelease
ifNil: [^ nil].
item isPackageRelease
ifTrue: [^ self installPackageRelease: item]
+ ifFalse: [release := item lastReleaseForCurrentSystemVersion.
- ifFalse: [release := item lastPublishedReleaseForCurrentSystemVersion.
release
ifNil: [(self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?')
ifTrue: [release := item lastPublishedRelease.
release
ifNil: [(self confirm: 'The package has no published release at all, take the latest of the unpublished releases?')
ifTrue: [release := item lastRelease]]]].
release
ifNotNil: [^ self installPackageRelease: release]]!
Item was changed:
----- Method: SMLoaderPlus>>installPackageRelease (in category 'actions') -----
installPackageRelease
"Install selected package or release.
The cache is used."
| item release |
item := self selectedPackageOrRelease
ifNil: [^ nil].
item isPackageRelease
ifTrue: [^ self installPackageRelease: item]
+ ifFalse: [release := item lastReleaseForCurrentSystemVersion.
- ifFalse: [release := item lastPublishedReleaseForCurrentSystemVersion.
release
ifNil: [(self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?')
ifTrue: [release := item lastPublishedRelease.
release
ifNil: [(self confirm: 'The package has no published release at all, take the latest of the unpublished releases?')
ifTrue: [release := item lastRelease]]]].
release
ifNotNil: [^ self installPackageRelease: release]]!
Item was changed:
----- Method: SMReleaseBrowser>>save (in category 'initialize-release') -----
save
"Save the release to SqueakMap."
Cursor wait showWhile:
[ self dependents do:
[ : eachWidget | #(#username #password #note #version #content ) do:
[ : eachName | eachWidget knownName = eachName ifTrue:
[ eachWidget hasUnacceptedEdits ifTrue: [ eachWidget accept ] ] ] ].
self validateCanSave.
[ self
writeInstallFile ;
login.
"Save without a downloadUrl so that SM will update its cache and we can also verify success before uploading the file."
self savePackageRelease: nil.
self loadScript isEmptyOrNil ifFalse:
[ self uploadInstallFile.
release package addRelease: release.
"Now save with the correct downloadUrl."
self
savePackageRelease: self downloadUrl ;
+ deleteInstallFile ] ] ensure: [ self logout ].
+ release refreshInCache ].
- deleteInstallFile ] ] ensure: [ self logout ] ].
self closeWindow!
Chris Muller uploaded a new version of SMBase to project The Trunk:
http://source.squeak.org/trunk/SMBase-cmm.141.mcz
==================== Summary ====================
Name: SMBase-cmm.141
Author: cmm
Time: 15 April 2019, 9:12:33.599161 pm
UUID: 3a337c87-d640-48e6-8b6f-8944694d6942
Ancestors: SMBase-cmm.140
Fix SMPackageRelease>>#newerThan: to account for the possibility that the automaticVersion's its comparing might be from different branches, which can't be compared via #<.
=============== Diff against SMBase-cmm.140 ===============
Item was changed:
----- Method: SMPackageRelease>>newerThan: (in category 'testing') -----
+ newerThan: aRelease
- newerThan: aRelease
"Answer if this release was made after <aRelease>."
+ ^ (aRelease automaticVersion inSameBranchAs: automaticVersion)
+ ifTrue: [ aRelease automaticVersion < automaticVersion ]
+ ifFalse: [ aRelease automaticVersion numbers first > automaticVersion numbers first ]!
-
- ^aRelease automaticVersion < automaticVersion!
Fabio Niephaus uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-fn.825.mcz
==================== Summary ====================
Name: Collections-fn.825
Author: fn
Time: 12 April 2019, 9:30:29.397159 am
UUID: 3110d8f6-fa38-4d91-8358-aed2eadbd9a7
Ancestors: Collections-nice.824
Just like strings, characters should convert themselves to an integer when involved in arithmetic with a number.
Example:
$c < 98.9 "false"
98.9 < $c "opened debugger, now returns true"
=============== Diff against Collections-nice.824 ===============
Item was added:
+ ----- Method: Character>>adaptToNumber:andSend: (in category 'converting') -----
+ adaptToNumber: rcvr andSend: selector
+ "If I am involved in arithmetic with a number, convert me to an integer."
+
+ ^ rcvr perform: selector with: self asInteger!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.824.mcz
==================== Summary ====================
Name: Collections-nice.824
Author: nice
Time: 7 April 2019, 10:40:26.559826 pm
UUID: e6d75dba-26a8-4945-a930-3d79f8cd4969
Ancestors: Collections-ul.823
Implement Collection>>#log2, since it already responds to #ln and #log...
Correct a Pharoism in DefaultSortFunction comment, there is no #threeWayCompareTo: because we prefer the space-ship operator <=>
Correct a slip in LazyCharacterSet comment.
Let ({1. 3/2. 2} as: Interval) work as it should.
Remove Interval>>#remove: since it duplicates unecessarily super remove:ifAbsent: (which shouldNotImplement already).
Don't spend too much time sorting an Interval, it's already sorted.
=============== Diff against Collections-ul.823 ===============
Item was added:
+ ----- Method: Collection>>log2 (in category 'math functions') -----
+ log2
+ ^ self collect: [:each | each log2]!
Item was changed:
SortFunction subclass: #DefaultSortFunction
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Collections-SortFunctions'!
+ !DefaultSortFunction commentStamp: 'nice 4/6/2019 15:08' prior: 0!
+ A DefaultSortFunction is a collator using the default three way compare <=> operator.
- !DefaultSortFunction commentStamp: 'nice 11/7/2017 23:43' prior: 0!
- A DefaultSortFunction is a collator using the default <=> operator.
It is known to work on String and Magnitude.
It is generally not usefull to create a new instance, and the recommended pattern is to use the single instance available by sending the message SortFunction default .
+ For other objects that don't understand <=> it is necessary to use a custom SortFunction rather than the default one.
- For other objects that don't understand threeWayCompareTo: it is necessary to use a custom SortFunction rather than the default one.
!
Item was changed:
----- Method: Interval class>>newFrom: (in category 'instance creation') -----
newFrom: aCollection
"Answer an instance of me containing the same elements as aCollection."
| newInterval n |
-
(n := aCollection size) <= 1 ifTrue: [
n = 0 ifTrue: [^self from: 1 to: 0].
+ ^self from: aCollection anyOne to: aCollection anyOne].
+ newInterval := self
+ from: aCollection first
+ to: aCollection last
+ by: (aCollection last - aCollection first) / (n - 1).
+ (newInterval hasEqualElements: aCollection)
+ ifFalse:
+ [self error: 'The argument is not an arithmetic progression'].
- ^self from: aCollection first to: aCollection last].
- newInterval := self from: aCollection first to: aCollection last
- by: (aCollection last - aCollection first) // (n - 1).
- aCollection ~= newInterval
- ifTrue: [
- "Give a second chance, because progression might be arithmetic, but = answer false"
- (newInterval hasEqualElements: aCollection) ifFalse: [
- self error: 'The argument is not an arithmetic progression']].
^newInterval
" Interval newFrom: {1. 2. 3}
{33. 5. -23} as: Interval
{33. 5. -22} as: Interval (an error)
(-4 to: -12 by: -1) as: Interval
#(2 4 6) asByteArray as: Interval.
"!
Item was removed:
- ----- Method: Interval>>remove: (in category 'removing') -----
- remove: newObject
- "Removing from an Interval is not allowed."
-
- self error: 'elements cannot be removed from an Interval'!
Item was added:
+ ----- Method: Interval>>sorted (in category 'sorting') -----
+ sorted
+ "an Interval is already sorted"
+ step < 0 ifTrue: [^self reversed].
+ ^self!
Item was changed:
CharacterSet subclass: #LazyCharacterSet
instanceVariableNames: 'block'
classVariableNames: ''
poolDictionaries: ''
category: 'Collections-Support'!
+ !LazyCharacterSet commentStamp: 'nice 2/12/2019 22:36' prior: 0!
- !LazyCharacterSet commentStamp: 'nice 11/30/2017 21:40' prior: 0!
A LazyCharacterSet is a kind of CharacterSet which does not know in advance which Character it contains or not.
If will lazily evaluate a block on demand if ever one ask whether it includes: a character.
It is not feasible to enumerate a LazyCharacterSet, because there are way too many characters.
Instance Variables
block: <BlockContext | Symbol>
byteArrayMapCache: <ByteArray | nil>
block
- a valuable, answering either true or false when sent the message value: - true means that this set includes the character passed as value: argument.
byteArrayMapCache
+ - a cache holding 0 or 1 for the first 256 character codes - 0 meaning not included, 1 included. This is used in some primitives
- - a cache holding 0 or 1 for the first 256 character codes - 0 meaning not included, 1 included. This is used in some priitives
!
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.305.mcz
==================== Summary ====================
Name: CollectionsTests-nice.305
Author: nice
Time: 7 April 2019, 10:28:19.324177 pm
UUID: 62b39b3b-abb9-43d1-aa10-dbf15359c36b
Ancestors: CollectionsTests-nice.304
More and Less Interval tests - Part 2
- cleanup the testEquals
* remove redundant test vs Array: a single #testEqualsWithArray is enough
* make an explicit testEqualsWhenEmpty for empty Interval equality.
This is a feature required for Text selection support.
An empty Interval is used for marking cursor position when Text selection is empty.
- It should be possible to convert an Array with fractional arithmetic progression as Interval (#testAsIntervalWithFractionalProgression), though it's currently not the case at this time of writing
- add a case of surprising fuzzy-inclusion behavior (copyWithout:)
- document two additional weird behaviors of Interval of Float:
* testIntervalOfFloatEqual denies the common sense, and thus currently does not fail. It could as well assert and be an expected failure, but we will probably not resolve it.
* testIntervalOfFloatLast fails if last is not corrected. Unlike equal, it seems possible to resolve while preserving other Interval properties
=============== Diff against CollectionsTests-nice.304 ===============
Item was added:
+ ----- Method: IntervalTest>>testAsIntervalWithFractionalProgression (in category 'tests') -----
+ testAsIntervalWithFractionalProgression
+ self assert: (1 to: 2 by: 1/2) equals: ({1. 3/2. 2} as: Interval).
+ self assert: (1 to: 2 by: 0.2s) equals: ({1. 1.2s. 1.4s. 1.6s. 1.8s. 2} as: Interval).
+
+ self should: [#(0.1 0.2 0.3 0.4) as: Interval]
+ raise: Error
+ description: 'There is no guaranty that Interval of Float can be constructed from individual Float'.
+ "Even though, by chance there might be a Float Interval with same elements"
+ #(0.1 0.2 0.3 0.4) hasEqualElements: (0.1 to: 0.4 by: 0.1 predecessor)!
Item was changed:
----- Method: IntervalTest>>testEquals (in category 'tests') -----
testEquals
+ self assert: (3 to: 5) = (3.0 to: 5.0).
+ self deny: (3 to: 5) = (3 to: 5 by: 2) description: 'Sharing bounds is not enough to make Interval equals'.!
- self deny: (3 to: 5) = #(3 4 5).
- self deny: (3 to: 5) = #(3 5).
- self deny: (3 to: 5) = #().
-
- self deny: #(3 4 5) = (3 to: 5).
- self deny: #(3 5) = (3 to: 5).
- self deny: #() = (3 to: 5).!
Item was removed:
- ----- Method: IntervalTest>>testEquals4 (in category 'tests') -----
- testEquals4
-
- self deny: (3 to: 5 by: 2) = #(3 5).
- self deny: (3 to: 5 by: 2) = #(3 4 5).
- self deny: (3 to: 5 by: 2) = #().
-
- self deny: #(3 5) = (3 to: 5 by: 2).
- self deny: #(3 4 5) = (3 to: 5 by: 2).
- self deny: #() = (3 to: 5 by: 2).!
Item was added:
+ ----- Method: IntervalTest>>testEqualsWhenEmpty (in category 'tests') -----
+ testEqualsWhenEmpty
+ self assert: (3 to: 2) = (3 to: 2) copy.
+ self deny: (3 to: 2) = (2 to: 1)
+ description: 'Empty intervals are considered different if their bound differs. Text selection rely on this feature'.!
Item was added:
+ ----- Method: IntervalTest>>testEqualsWithArray (in category 'tests') -----
+ testEqualsWithArray
+ "Intervals are not considered equal to Array, even if they share the same sequence of elements."
+ self deny: (3 to: 5) = #(3 4 5).
+ self deny: #(3 4 5) = (3 to: 5).!
Item was added:
+ ----- Method: IntervalTest>>testIntervalOfFloatEqual (in category 'tests') -----
+ testIntervalOfFloatEqual
+ "Interval with Float are weirdos"
+
+ | interval1 interval2 interval3 interval4 |
+ interval1 := (0 to: 1 by: 1/10).
+ interval2 := (0.0 to: 1 by: 1/10).
+ self deny: (interval1 = interval2) ==> (interval1 hasEqualElements: interval2)
+ description: 'Interval of Float may have different elements from another Interval, even if they pretend to be equal.'.
+
+ interval3 := (0.3 to: 0.6 by: 1/10).
+ interval4 := (0.3 to: 0.6 by: 0.1).
+ self deny: (interval3 hasEqualElements: interval4) ==> (interval3 = interval4)
+ description: 'Interval of Float may pretend they differ from another Interval even if they have same elements.'.!
Item was added:
+ ----- Method: IntervalTest>>testIntervalOfFloatLast (in category 'tests') -----
+ testIntervalOfFloatLast
+ "Some definition of last were problematic for Interval of Float"
+
+ | increment upperBound interval |
+ self assert: (0.2 to: 0.9 by: 0.1) last = (0.2 to: 0.9 by: 0.1) asArray last
+ description: 'the last element cannot reasonably change when converting asArray'.
+
+ upperBound := 1.7.
+ increment := 0.1.
+ self deny: (0 to: upperBound by: increment) last > upperBound
+ description: 'the last element cannot reasonably exceed upper bound'.
+
+ interval := -0.9999999999999994 to: 1 by: 2.
+ self assert: interval last < interval first
+ ==> (interval isEmpty or: [interval increment < 0])
+ description: 'the last element cannot reasonably deceed(*) lower bound (* be inferior to)'!
Item was changed:
----- Method: IntervalTest>>testSurprisingFuzzyInclusionBehavior (in category 'tests') -----
testSurprisingFuzzyInclusionBehavior
"If ever Interval implement fuzzy inclusion, then we can expect weird logic..."
+ self assert: ((0.1 to: 0.9 by: 0.1) includes: 0.3)
- self assert: ((0.1 to: 0.9 by: 0.1) asArray includes: 0.3)
==> (((0.1 to: 0.9 by: 0.1) occurrencesOf: 0.3) > 0)
description: 'A Collection that includes something has at least one occurrence of something'.
self assert: ((0.1 to: 0.9 by: 0.1) lastIndexOf: 0.3)
>= ((0.1 to: 0.9 by: 0.1) indexOf: 0.3)
+ description: 'The last index of an object in a SequenceableCollection should be greater than or equal to the first index'.
+ self assert: ((0.1 to: 0.9 by: 0.1) includes: 0.3)
+ ==> (((0.1 to: 0.9 by: 0.1) copyWithout: 0.3) size < (0.1 to: 0.9 by: 0.1) size)
+ description: 'A Collection should be able to shrink by stripping own elements'.!
- description: 'If the last index of an object in a SequenceableCollection should be greater or equal to the first index'.!
Nicolas Cellier uploaded a new version of ShoutTests to project The Trunk:
http://source.squeak.org/trunk/ShoutTests-nice.27.mcz
==================== Summary ====================
Name: ShoutTests-nice.27
Author: nice
Time: 7 April 2019, 2:43:38.674687 pm
UUID: 3f8b54af-406e-40fe-9666-d3101106a25f
Ancestors: ShoutTests-ul.26
Expression like 1to:-1 are valid Smalltalk syntax, even without spaces.
Document that with a shout test.
Note that Shout currently refuses this syntax.
This works with a space after the colon
1to: -1
=============== Diff against ShoutTests-ul.26 ===============
Item was added:
+ ----- Method: SHParserST80Test>>testNegativeNumberWithoutSpace (in category 'tests') -----
+ testNegativeNumberWithoutSpace
+ | types tokens s |
+ s := 'x 1to:-1'.
+ types := self tokenTypesIn: s.
+ tokens := self tokensIn: s.
+ self assert: types = #(#patternUnary #number #keyword #- #number).
+ self assert: tokens = #('x' '1' 'to:' '-' '1').!
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.304.mcz
==================== Summary ====================
Name: CollectionsTests-nice.304
Author: nice
Time: 6 April 2019, 3:55:40.624272 pm
UUID: e6dfc4bf-906d-4e7d-8bb4-1fc6fc5bbe4b
Ancestors: CollectionsTests-ul.303
More and less Interval tests
- Once upon a time, I changed reversed to answer an Interval, which is a good thing...
Err, except for Interval of floats (which are generally not well behaved objects)...
I don't know if we must revert reversed, or hack special case of Float Intervals (I have some idea), but we should at least document the behavior.
- Once upon a time, I fixed implementation of fuzzy inclusion in Interval. But I don't really approve the feature.
Fuzzy inclusion produce several unconsistencies in Interval behavior which goes against a principle of least astonishment.
As we say, you can cheat as long as you don't get caught... Gotcha!
- Remove testNumericTypes which does not assert anything, which seems to ignore the basics of Smalltalk selector precedence, and which would rely on abandoned equality between Interval and Array.
=============== Diff against CollectionsTests-ul.303 ===============
Item was added:
+ ----- Method: IntervalTest>>testIntervalOfFloatReversed (in category 'tests') -----
+ testIntervalOfFloatReversed
+ self assert: (-16.3 to: 20.1 by: 1.3) reversed size
+ equals: (-16.3 to: 20.1 by: 1.3) size
+ description: 'reversed should preserve the size of a collection'.
+ self assert: (0.1 to: 0.9 by: 0.1) reversed asArray
+ equals: (0.1 to: 0.9 by: 0.1) asArray reversed
+ description: 'reversed should preserve the elements of a collection'.!
Item was removed:
- ----- Method: IntervalTest>>testNumericTypes (in category 'tests') -----
- testNumericTypes
-
- (3 asNumber) to: 5 = #(3 4 5).
-
- 3.0 to: 5.0 = #(3.0 4.0 5.0).
- 3.0 to: 5.0 by: 0.5 = #(3.0 3.5 4.0 4.5 5.0).
-
- 3/1 to: 5/1 = #(3 4 5).
- 1/2 to: 5/2 by: 1/2 = #(1/2 1 3/2 2 5/2).!
Item was added:
+ ----- Method: IntervalTest>>testSurprisingFuzzyInclusionBehavior (in category 'tests') -----
+ testSurprisingFuzzyInclusionBehavior
+ "If ever Interval implement fuzzy inclusion, then we can expect weird logic..."
+ self assert: ((0.1 to: 0.9 by: 0.1) asArray includes: 0.3)
+ ==> (((0.1 to: 0.9 by: 0.1) occurrencesOf: 0.3) > 0)
+ description: 'A Collection that includes something has at least one occurrence of something'.
+ self assert: ((0.1 to: 0.9 by: 0.1) lastIndexOf: 0.3)
+ >= ((0.1 to: 0.9 by: 0.1) indexOf: 0.3)
+ description: 'If the last index of an object in a SequenceableCollection should be greater or equal to the first index'.!