Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*grease-gemstone-core
greaseBeginsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*grease-gemstone-core
greaseEndsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*Grease-Pharo100-Core
beginsWithSubCollection: aSequenceableCollection
"Some platforms implement #beginsWith: to answer true for an empty argument."
self
greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:'
details: 'Use SequenceableCollection>>#greaseBegins:'.
aSequenceableCollection isEmpty ifTrue: [ ^ false ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*Grease-Pharo100-Core
endsWithSubCollection: aSequenceableCollection
"Some platforms implement #endsWith: to answer true for an empty argument."
self
greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:'
details: 'Use SequenceableCollection>>#greaseEndsWith:'.
aSequenceableCollection isEmpty ifTrue: [ ^ false ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Grease-Pharo100-Core
greaseBeginsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Grease-Pharo100-Core
greaseEndsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ initialize
super initialize.
self rewriteRule
replace: '`@collection beginsWith: `@subCollection'
with: '`@collection beginsWithSubCollection: `@subCollection';
with: '`@collection greaseBeginsWith: `@subCollection';
replace: '`@collection endsWith: `@subCollection'
with: '`@collection endsWithSubCollection: `@subCollection'
with: '`@collection greaseEndsWith: `@subCollection'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Grease-Pharo70-Core
greaseBeginsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Grease-Pharo70-Core
greaseEndsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*Grease-Pharo90-Core
beginsWithSubCollection: aSequenceableCollection

self
greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:'
details: 'Use SequenceableCollection>>#greaseBeginsWith:'.
"Some platforms implement #beginsWith: to answer true for an empty argument."
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*Grease-Pharo90-Core
endsWithSubCollection: aSequenceableCollection

self
greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:'
details: 'Use SequenceableCollection>>#greaseEndsWith:'.
"Some platforms implement #endsWith: to answer true for an empty argument."
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Grease-Pharo90-Core
greaseBeginsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Grease-Pharo90-Core
greaseEndsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ initialize
super initialize.
self rewriteRule
replace: '`@collection beginsWith: `@subCollection'
with: '`@collection beginsWithSubCollection: `@subCollection';
with: '`@collection greaseBeginsWith: `@subCollection';
replace: '`@collection endsWith: `@subCollection'
with: '`@collection endsWithSubCollection: `@subCollection'
with: '`@collection greaseEndsWith: `@subCollection'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ initialize
super initialize.
self rewriteRule
replace: '`@collection beginsWith: `@subCollection'
with: '`@collection beginsWithSubCollection: `@subCollection';
with: '`@collection greaseBeginsWith: `@subCollection';
replace: '`@collection endsWith: `@subCollection'
with: '`@collection endsWithSubCollection: `@subCollection'
with: '`@collection greaseEndsWith: `@subCollection'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*grease-squeak5-core
greaseBeginsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*grease-squeak5-core
greaseEndsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*grease-squeak6-core
beginsWithSubCollection: aSequenceableCollection
self
greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:'
details: 'Use SequenceableCollection>>#greaseBeginsWith:'.
"Some platforms implement #beginsWith: to answer true for an empty argument."
aSequenceableCollection isEmpty ifTrue: [ ^ false ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*grease-squeak6-core
endsWithSubCollection: aSequenceableCollection
self
greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:'
details: 'Use SequenceableCollection>>#greaseEndsWith:'.
"Some platforms implement #endsWith: to answer true for an empty argument."
aSequenceableCollection isEmpty ifTrue: [ ^ false ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*grease-squeak6-core
greaseBeginsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*grease-squeak6-core
greaseEndsWith: aSequenceableCollection

aSequenceableCollection isEmpty ifTrue: [ ^ true ].
^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests
testGreaseBeginsWith
| collection |
collection := self arbitraryCollection.
self assert: (collection greaseBeginsWith: (collection copyWithout: collection last)).
self assert: (collection greaseBeginsWith: collection).
self deny: (collection greaseBeginsWith: (collection copyWith: collection first)).
self assert: (collection greaseBeginsWith: self emptyCollection).
self deny: (self emptyCollection greaseBeginsWith: collection)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests
testGreaseEndsWith
| collection |
collection := self arbitraryCollection.
self assert: (collection greaseEndsWith: (collection copyWithout: collection first)).
self assert: (collection greaseEndsWith: collection).
self deny: (collection greaseEndsWith: (collection copyWith: collection first)).
self assert: (collection greaseEndsWith: self emptyCollection).
self deny: (self emptyCollection greaseEndsWith: collection)
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ testNotPortableCollectionsRule
self
runTransformation: GRNotPortableCollectionsRule
changes: #(
'beginsWith1 ''abc'' beginsWithSubCollection: ''a'''
'endsWith1 ''abc'' endsWithSubCollection: ''a''')
'beginsWith1 ''abc'' greaseBeginsWith: ''a'''
'endsWith1 ''abc'' greaseEndsWith: ''a''')