-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-candidate' into gs64-math
- Loading branch information
Showing
18 changed files
with
324 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| symbolDictionary | | ||
symbolDictionary := Rowan image | ||
symbolDictNamed:'Buoy' | ||
ifAbsent: [ | ||
Rowan image symbolList createDictionaryNamed: 'Buoy' at: 1. | ||
Rowan image symbolDictNamed:'Buoy' | ||
]. | ||
symbolDictionary at: #SubscriptOutOfBounds put: OffsetError. | ||
symbolDictionary at: #NotFound put: LookupError. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
.../Buoy-Collections/Collection.extension.st → ...ctions-Extensions/Collection.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
source/Buoy-Collections-Extensions/SequenceableCollection.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
source/Buoy-Collections-GS64-Extensions/Array.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Extension { #name : #Array } | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
Array >> fillFrom: aCollection with: aBlock [ | ||
|
||
| index | | ||
index := 0. | ||
aCollection do: [ :each | | ||
self at: (index := index + 1) put: (aBlock value: each) ] | ||
] | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
Array class >> newFrom: aCollection [ | ||
"Answer an instance of me containing the same elements as aCollection." | ||
|
||
| newArray | | ||
newArray := self new: aCollection size. | ||
1 to: aCollection size do: [ :i | | ||
newArray at: i put: (aCollection at: i) ]. | ||
^ newArray | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
source/Buoy-Collections-GS64-Extensions/SequenceableCollection.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,45 @@ | ||
Extension { #name : #SequenceableCollection } | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
SequenceableCollection >> anyOne [ | ||
|
||
^ self first | ||
] | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
SequenceableCollection >> copyAfter: anElement [ | ||
"Answer a copy of the receiver from after the first occurrence | ||
of anElement up to the end. If no such element exists, answer | ||
an empty copy." | ||
|
||
^ self allButFirst: (self indexOf: anElement ifAbsent: [^ self copyEmpty]) | ||
] | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
SequenceableCollection >> endsWith: aSequenceableCollection [ | ||
"Answer true if the receiver ends with the argument collection" | ||
|
||
| start | | ||
aSequenceableCollection ifEmpty: [ ^true ]. | ||
(self size < aSequenceableCollection size) ifTrue: [^false]. | ||
start := self size - aSequenceableCollection size. | ||
aSequenceableCollection withIndexDo: [:each :index | (self at: start + index) ~= each ifTrue: [^false]]. | ||
^true | ||
] | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
SequenceableCollection >> isSequenceable [ | ||
|
||
^ true | ||
] | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
SequenceableCollection >> removeAll [ | ||
|
||
self ifNotEmpty: [ self removeFrom: 1 to: self size ] | ||
] | ||
|
||
{ #category : #'*Buoy-Collections-GS64-Extensions' } | ||
SequenceableCollection >> writeStream [ | ||
^ WriteStream on: self | ||
] |
7 changes: 7 additions & 0 deletions
7
source/Buoy-Collections-Pharo-Extensions/SequenceableCollection.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : #SequenceableCollection } | ||
|
||
{ #category : #'*Buoy-Collections-Pharo-Extensions' } | ||
SequenceableCollection >> copyLast: n [ | ||
|
||
^ [ self copyFrom: self size - n + 1 to: self size ] unless: n = 0 inWhichCase: [ self species new ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'Buoy-Collections-Pharo-Extensions' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.