Skip to content

Commit 7b843e1

Browse files
committedFeb 13, 2025·
Whitespace
Signed-off-by: Stefan Marr <[email protected]>
1 parent d4c5c64 commit 7b843e1

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed
 

‎Smalltalk/Object.som

+13-13
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
Object = nil (
2727
class = primitive
2828
objectSize = primitive "size in bytes"
29-
29+
3030
"Comparing"
3131

3232
" If you override =, you MUST override hashcode as well. The rule
@@ -38,15 +38,15 @@ Object = nil (
3838
~= other = (^ (self == other) not )
3939
isNil = ( ^false )
4040
notNil = ( ^true )
41-
41+
4242
"Converting"
4343
asString = ( ^'instance of ' + (self class) )
4444
, element = ( ^(Vector new append: self) append: element )
4545
hashcode = primitive
46-
46+
4747
"Evaluating"
4848
value = ( ^self )
49-
49+
5050
"Convenience"
5151
ifNil: aBlock = (^self)
5252
ifNotNil: aBlock = (^aBlock value)
@@ -60,27 +60,27 @@ Object = nil (
6060
"Debugging"
6161
inspect = primitive
6262
halt = primitive
63-
63+
6464
"Error handling"
6565
error: string = ( '' println. ('ERROR: ' + string) println. system exit: 1 )
66-
66+
6767
"Abstract method support"
6868
subclassResponsibility = (
6969
self error: 'This method is abstract and should be overridden'
7070
)
71-
71+
7272
"Error recovering"
7373
doesNotUnderstand: selector arguments: arguments = (
7474
self error:
7575
('Method ' + selector + ' not found in class ' + self class name)
7676
)
77-
77+
7878
escapedBlock: block = (
7979
self error: 'Block has escaped and cannot be executed'
8080
)
81-
81+
8282
unknownGlobal: name = ( ^system resolve: name )
83-
83+
8484
"Reflection"
8585
respondsTo: aSymbol = (
8686
(self class hasMethod: aSymbol)
@@ -93,13 +93,13 @@ Object = nil (
9393
ifFalse: [ cls := cls superclass ] ].
9494
^ false ]
9595
)
96-
96+
9797
perform: aSymbol = primitive
9898
perform: aSymbol withArguments: args = primitive
99-
99+
100100
perform: aSymbol inSuperclass: cls = primitive
101101
perform: aSymbol withArguments: args inSuperclass: cls = primitive
102-
102+
103103
instVarAt: idx = primitive
104104
instVarAt: idx put: obj = primitive
105105
instVarNamed: sym = primitive

‎TestSuite/ReflectionTest.som

+11-11
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ReflectionTest = TestCase (
3131
self assert: (23 respondsTo: #isNil).
3232
self assert: (23 respondsTo: #+).
3333
)
34-
34+
3535
testMethods = (
3636
"First method in Object should be #class."
3737
self assert: #class equals: (Object methods at: 1) signature.
@@ -42,50 +42,50 @@ ReflectionTest = TestCase (
4242
| o |
4343
self assert: Integer equals: (23 perform: #class).
4444
self assert: (23 perform: #between:and: withArguments: (Array with: 22 with: 24)).
45-
45+
4646
o := SuperTest new.
4747
self assert: #super equals: (o perform: #something inSuperclass: SuperTestSuperClass).
48-
48+
4949
"Trying to see whether the stack in bytecode-based SOMs works properly"
5050
self assert: #a equals: ((23 perform: #class) = Integer ifTrue: [#a] ifFalse: [#b]).
5151

5252
self assert: 28 equals: 5 + (23 perform: #value).
5353
)
54-
54+
5555
testInstVarAtAndPut = (
5656
| tmp |
5757
"Testing #at: and #at:put:"
5858
tmp := Pair withKey: 3 andValue: 42.
59-
59+
6060
self assert: tmp key equals: (tmp instVarAt: 1).
61-
61+
6262
tmp instVarAt: 1 put: #foo.
6363
self assert: #foo equals: tmp key.
6464
)
65-
65+
6666
testName = (
6767
self assert: #Object equals: Object name.
6868
self assert: #'Object class' equals: Object class name.
6969
self assert: #Integer equals: 1 class name.
7070
)
71-
71+
7272
testAsString = (
7373
self assert: 'Object' equals: Object asString.
7474
self assert: 'Object class' equals: Object class asString.
7575
self assert: 'Integer' equals: 1 class asString.
7676
)
77-
77+
7878
testSelectors = (
7979
| sels |
8080
sels := Object selectors.
8181
self assert: 33 equals: sels length.
8282

8383
sels contains: #=.
8484
self assert: (Object hasMethod: #=).
85-
85+
8686
sels contains: #value.
8787
self assert: (Object hasMethod: #value).
88-
88+
8989
sels contains: #notNil.
9090
self assert: (Object hasMethod: #notNil).
9191
)

0 commit comments

Comments
 (0)
Please sign in to comment.