Skip to content

Commit 16a3d09

Browse files
authored
Merge pull request #87 from ba-st/gs64-math
GS64: Add Math packages
2 parents 0ead8e4 + b4c909f commit 16a3d09

35 files changed

+308
-132
lines changed

rowan/components/Deployment.ston

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ RwSimpleProjectLoadComponentV2 {
1515
'Buoy-Conditions-Extensions',
1616
'Buoy-Dynamic-Binding',
1717
'Buoy-Exception-Handling-Extensions',
18+
'Buoy-Math',
19+
'Buoy-Math-Extensions',
20+
'Buoy-Math-GS64-Base-Extensions',
1821
'Buoy-Math-GS64-Extensions',
1922
'Buoy-Metaprogramming',
2023
'Buoy-Metaprogramming-Extensions',
@@ -42,7 +45,10 @@ RwSimpleProjectLoadComponentV2 {
4245
'Buoy-Exception-Handling-Extensions' : {
4346
'symbolDictName' : 'Globals'
4447
},
45-
'Buoy-Math-GS64-Extensions' : {
48+
'Buoy-Math-Extensions' : {
49+
'symbolDictName' : 'Globals'
50+
},
51+
'Buoy-Math-GS64-Base-Extensions' : {
4652
'symbolDictName' : 'Globals'
4753
},
4854
'Buoy-Metaprogramming-Extensions' : {

rowan/components/Tests.ston

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RwSimpleProjectLoadComponentV2 {
1313
'Buoy-Conditions-Tests',
1414
'Buoy-Dynamic-Binding-Tests',
1515
'Buoy-Exception-Handling-Tests',
16+
'Buoy-Math-Tests',
1617
'Buoy-Metaprogramming-Tests',
1718
'Buoy-SUnit-Tests'
1819
],
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
| symbolDictionary |
22
symbolDictionary := Rowan image
3-
symbolDictNamed:'Buoy'
3+
symbolDictNamed: 'Buoy'
44
ifAbsent: [
55
Rowan image symbolList createDictionaryNamed: 'Buoy' at: 1.
6-
Rowan image symbolDictNamed:'Buoy'
6+
Rowan image symbolDictNamed: 'Buoy'
77
].
88
symbolDictionary at: #SubscriptOutOfBounds put: OffsetError.
99
symbolDictionary at: #NotFound put: LookupError.
10-
10+
symbolDictionary at: #ArithmeticError put: NumericError.

source/BaselineOfBuoy/BaselineOfBuoy.class.st

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,20 @@ BaselineOfBuoy >> baselineMath: spec [
131131
spec
132132
package: 'Buoy-Math' with: [ spec requires: 'Buoy-Assertions' ];
133133
group: 'Deployment' with: 'Buoy-Math';
134-
package: 'Buoy-Math-Tests' with: [ spec requires: #('Buoy-Math' 'Dependent-SUnit-Extensions') ];
135-
group: 'Tests' with: 'Buoy-Math-Tests'
134+
package: 'Buoy-Math-Extensions'
135+
with: [ spec requires: 'Buoy-Math' ];
136+
group: 'Deployment' with: 'Buoy-Math-Extensions';
137+
package: 'Buoy-Math-Pharo-Extensions'
138+
with: [ spec requires: 'Buoy-Math' ];
139+
group: 'Deployment' with: 'Buoy-Math-Pharo-Extensions';
140+
package: 'Buoy-Math-Tests' with: [
141+
spec requires:
142+
#( 'Buoy-Math-Extensions' 'Buoy-Math-Pharo-Extensions'
143+
'Dependent-SUnit-Extensions' ) ];
144+
group: 'Tests' with: 'Buoy-Math-Tests';
145+
package: 'Buoy-Math-Pharo-Extensions-Tests' with: [
146+
spec requires: 'Buoy-Math-Tests' ];
147+
group: 'Tests' with: 'Buoy-Math-Pharo-Extensions-Tests'
136148
]
137149

138150
{ #category : #baselines }
@@ -159,6 +171,8 @@ BaselineOfBuoy >> baselineSUnit: spec [
159171
spec
160172
package: 'Buoy-SUnit-Model';
161173
group: 'Dependent-SUnit-Extensions' with: 'Buoy-SUnit-Model';
174+
package: 'Buoy-SUnit-Pharo-Extensions';
175+
group: 'Dependent-SUnit-Extensions' with: 'Buoy-SUnit-Pharo-Extensions';
162176
package: 'Buoy-SUnit-Tests' with: [ spec requires: 'Dependent-SUnit-Extensions' ];
163177
group: 'Tests' with: 'Buoy-SUnit-Tests'
164178
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"
2+
BinaryFloat is an abstract class in GS64, the superclass of different implementations of Binary
3+
floating point.
4+
This version is just a placeholder so we can easily create extensions methods to load in GS64 specific
5+
packages.
6+
"
7+
Class {
8+
#name : #BinaryFloat,
9+
#superclass : #Number,
10+
#category : #'Buoy-GS64-Compatibility'
11+
}

source/Buoy-GS64-Compatibility/ClassOrganizer.class.st

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"
2-
In GS64, a `ClassOrganizer` can answer queries about classes in the image, provides
3-
tools and reports on information on classes and methods and can perform
4-
cross-referencing and fileout.
2+
In GS64, a `ClassOrganizer` can answer queries about classes in the image, provides tools and reports
3+
on information on classes and methods and can perform cross-referencing and fileout.
4+
5+
This version is just a placeholder so we can easily create extension methods referencing this class
6+
in GS64 specific packages.
57
"
68
Class {
79
#name : #ClassOrganizer,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Extension { #name : #Collection }
2+
3+
{ #category : #'*Buoy-GS64-Compatibility' }
4+
Collection >> any [
5+
6+
"Answer a representative sample of the receiver. It raises an error when the collection is empty. This method can be helpful when needing to preinfer the nature of the contents of semi-homogeneous collections."
7+
8+
self emptyCheck.
9+
self do: [ :each | ^ each ]
10+
]

source/Buoy-Math/Fraction.extension.st renamed to source/Buoy-Math-Extensions/Fraction.extension.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Extension { #name : #Fraction }
22

3-
{ #category : #'*Buoy-Math' }
3+
{ #category : #'*Buoy-Math-Extensions' }
44
Fraction >> adaptToFraction: aFraction andSend: selector [
55

66
^self perform: selector with: aFraction

source/Buoy-Math/Integer.extension.st renamed to source/Buoy-Math-Extensions/Integer.extension.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Extension { #name : #Integer }
22

3-
{ #category : #'*Buoy-Math' }
3+
{ #category : #'*Buoy-Math-Extensions' }
44
Integer >> adaptToInteger: anInteger andSend: selector [
55

66
^ self perform: selector with: anInteger

source/Buoy-Math/Number.extension.st renamed to source/Buoy-Math-Extensions/Number.extension.st

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Extension { #name : #Number }
22

3-
{ #category : #'*Buoy-Math' }
3+
{ #category : #'*Buoy-Math-Extensions' }
44
Number >> decreasedBy: aPercentage [
55

66
AssertionChecker
@@ -11,7 +11,7 @@ Number >> decreasedBy: aPercentage [
1111
^ self * (Percentage oneHundred - aPercentage)
1212
]
1313

14-
{ #category : #'*Buoy-Math' }
14+
{ #category : #'*Buoy-Math-Extensions' }
1515
Number >> increasedBy: aPercentage [
1616

1717
AssertionChecker
@@ -22,19 +22,19 @@ Number >> increasedBy: aPercentage [
2222
^ self * (Percentage oneHundred + aPercentage)
2323
]
2424

25-
{ #category : #'*Buoy-Math' }
25+
{ #category : #'*Buoy-Math-Extensions' }
2626
Number >> isPercentage [
2727

2828
^false
2929
]
3030

31-
{ #category : #'*Buoy-Math' }
31+
{ #category : #'*Buoy-Math-Extensions' }
3232
Number >> perMille [
3333

3434
^ PerMille of: self
3535
]
3636

37-
{ #category : #'*Buoy-Math' }
37+
{ #category : #'*Buoy-Math-Extensions' }
3838
Number >> percent [
3939

4040
^ Percentage of: self

0 commit comments

Comments
 (0)