Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.next #113

Merged
merged 5 commits into from
Jan 3, 2024
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
@@ -1,26 +1,26 @@
Extension { #name : #AbstractDictionary }
Extension { #name : 'AbstractDictionary' }

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary >> associations [

^ self associationsAsArray
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary >> associationsSelect: aBlock [

^ self selectAssociations: aBlock
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary >> at: key ifPresent: aPresentBlock ifAbsent: anAbsentBlock [

| presentValue |
presentValue := self at: key ifAbsent: [ ^ anAbsentBlock value ].
^ aPresentBlock cull: presentValue
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary >> at: key ifPresent: aBlock ifAbsentPut: anAbsentBlock [

| presentValue |
Expand All @@ -32,13 +32,13 @@ AbstractDictionary >> at: key ifPresent: aBlock ifAbsentPut: anAbsentBlock [
^ aBlock cull: presentValue
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary >> isDictionary [

^ true
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary class >> newFromPairs: anArray [
"Answer an instance of me associating (anArray at: i) to (anArray at: i+1)
for each odd i. anArray must have an even number of entries."
Expand All @@ -49,7 +49,7 @@ AbstractDictionary class >> newFromPairs: anArray [
^ newDictionary
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
AbstractDictionary >> removeAll [

^ self removeAllKeys: self keys
Expand Down
8 changes: 4 additions & 4 deletions source/Buoy-Collections-GS64-Extensions/Array.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Array }
Extension { #name : 'Array' }

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
Array >> fillFrom: aCollection with: aBlock [

| index |
Expand All @@ -9,13 +9,13 @@ Array >> fillFrom: aCollection with: aBlock [
self at: (index := index + 1) put: (aBlock value: each) ]
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
Array >> isArray [

^ true
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
Array class >> newFrom: aCollection [
"Answer an instance of me containing the same elements as aCollection."

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Extension { #name : #Character }
Extension { #name : 'Character' }

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
Character class >> escape [
"Answer the ASCII ESC character"

^self esc
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
Character class >> value: anInteger [

^self withValue: anInteger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #CharacterCollection }
Extension { #name : 'CharacterCollection' }

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> capitalized [

self ifEmpty: [ ^ self ].
Expand All @@ -10,45 +10,45 @@ CharacterCollection >> capitalized [
with: self withoutFirst
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection class >> cr [

^ self with: Character cr
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection class >> crlf [

^ self with: Character cr with: Character lf
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> expandMacros [

^ self expandMacrosWithArguments: #( )
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> expandMacrosWith: anObject [

^ self expandMacrosWithArguments: { anObject }
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> expandMacrosWith: anObject with: anotherObject [

^ self expandMacrosWithArguments:
(Array with: anObject with: anotherObject)
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> expandMacrosWith: anObject with: anotherObject with: thirdObject [

^ self expandMacrosWithArguments:
(Array with: anObject with: anotherObject with: thirdObject)
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> expandMacrosWith: anObject with: anotherObject with: thirdObject with: fourthObject [

^ self expandMacrosWithArguments: (Array
Expand All @@ -58,7 +58,7 @@ CharacterCollection >> expandMacrosWith: anObject with: anotherObject with: thir
with: fourthObject)
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> expandMacrosWithArguments: anArray [

| readStream char index |
Expand Down Expand Up @@ -110,7 +110,7 @@ CharacterCollection >> expandMacrosWithArguments: anArray [
ifFalse: [ char ]) ] ] ]
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> findTokens: delimiters [

| separators |
Expand All @@ -120,34 +120,34 @@ CharacterCollection >> findTokens: delimiters [
^ self substrings: separators
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> includesSubstring: substring [

^ substring isEmpty or: [
(self _findString: substring startingAt: 1 ignoreCase: false) ~~ 0 ]
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> isAllDigits [
"Return whether the receiver is composed entirely of digits and has at least one digit"

self ifEmpty: [ ^ false ].
^ self allSatisfy: #isDigit
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> isAsciiString [

^ self allSatisfy: [ :each | each codePoint <= 127 ]
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection class >> lf [

^ self with: Character lf
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> lines [
"Answer an array of lines composing this receiver without the line ending delimiters"

Expand All @@ -157,7 +157,7 @@ CharacterCollection >> lines [
self linesDo: [ :aLine | lines nextPut: aLine ] ]
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> linesDo: aBlock [
"Execute aBlock with each line in this string. The terminating line delimiters CR, LF or CRLF
pairs are not included in what is passed to aBlock"
Expand All @@ -166,31 +166,31 @@ CharacterCollection >> linesDo: aBlock [
aBlock value: (self copyFrom: start to: endWithoutDelimiters) ]
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> sorted [

^ self class withAll: super sorted
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> species [

^ self speciesForConversion
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> substrings [

^self subStrings
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection class >> tab [

^ self with: Character tab
]

{ #category : #'*Buoy-Collections-GS64-Extensions' }
{ #category : '*Buoy-Collections-GS64-Extensions' }
CharacterCollection >> withoutQuoting [
"Remove the initial and final quote marks (single quote for string, or double quotes for comments),
if present (and if matches nesting quotes). Have a look at testWithoutQuoting."
Expand Down
Loading
Loading