Skip to content

Commit 6d08b16

Browse files
author
Johan Brichau
authored
Merge pull request SeasideSt#157 from SeasideSt/emptySubCollectionMethods
Introduce greaseBeginsWith: and greaseEndsWith:
2 parents bbcb179 + 955fa54 commit 6d08b16

File tree

24 files changed

+110
-8
lines changed

24 files changed

+110
-8
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*grease-gemstone-core
2+
greaseBeginsWith: aSequenceableCollection
3+
4+
aSequenceableCollection isEmpty ifTrue: [ ^ true ].
5+
^ self beginsWith: aSequenceableCollection
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*grease-gemstone-core
2+
greaseEndsWith: aSequenceableCollection
3+
4+
aSequenceableCollection isEmpty ifTrue: [ ^ true ].
5+
^ self endsWith: aSequenceableCollection
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
*Grease-Pharo100-Core
22
beginsWithSubCollection: aSequenceableCollection
33
"Some platforms implement #beginsWith: to answer true for an empty argument."
4+
self
5+
greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:'
6+
details: 'Use SequenceableCollection>>#greaseBegins:'.
7+
aSequenceableCollection isEmpty ifTrue: [ ^ false ].
48
^ self beginsWith: aSequenceableCollection
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
*Grease-Pharo100-Core
22
endsWithSubCollection: aSequenceableCollection
33
"Some platforms implement #endsWith: to answer true for an empty argument."
4+
self
5+
greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:'
6+
details: 'Use SequenceableCollection>>#greaseEndsWith:'.
7+
aSequenceableCollection isEmpty ifTrue: [ ^ false ].
48
^ self endsWith: aSequenceableCollection
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*Grease-Pharo100-Core
2+
greaseBeginsWith: aSequenceableCollection
3+
4+
aSequenceableCollection isEmpty ifTrue: [ ^ true ].
5+
^ self beginsWith: aSequenceableCollection
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*Grease-Pharo100-Core
2+
greaseEndsWith: aSequenceableCollection
3+
4+
aSequenceableCollection isEmpty ifTrue: [ ^ true ].
5+
^ self endsWith: aSequenceableCollection

repository/Grease-Pharo40-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ initialize
33
super initialize.
44
self rewriteRule
55
replace: '`@collection beginsWith: `@subCollection'
6-
with: '`@collection beginsWithSubCollection: `@subCollection';
6+
with: '`@collection greaseBeginsWith: `@subCollection';
77
replace: '`@collection endsWith: `@subCollection'
8-
with: '`@collection endsWithSubCollection: `@subCollection'
8+
with: '`@collection greaseEndsWith: `@subCollection'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*Grease-Pharo70-Core
2+
greaseBeginsWith: aSequenceableCollection
3+
4+
aSequenceableCollection isEmpty ifTrue: [ ^ true ].
5+
^ self beginsWith: aSequenceableCollection
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*Grease-Pharo70-Core
2+
greaseEndsWith: aSequenceableCollection
3+
4+
aSequenceableCollection isEmpty ifTrue: [ ^ true ].
5+
^ self endsWith: aSequenceableCollection
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
*Grease-Pharo90-Core
22
beginsWithSubCollection: aSequenceableCollection
3+
4+
self
5+
greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:'
6+
details: 'Use SequenceableCollection>>#greaseBeginsWith:'.
37
"Some platforms implement #beginsWith: to answer true for an empty argument."
48
^ self beginsWith: aSequenceableCollection

0 commit comments

Comments
 (0)