Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.887.mcz
==================== Summary ====================
Name: Kernel-eem.887
Author: eem
Time: 27 November 2014, 1:19:50.961 pm
UUID: 888d2632-2d0a-49dd-b83a-b5aceb2c939d
Ancestors: Kernel-eem.886
A few more cases in COntextPart where objectClass:
should be used instead of class to avoid proxy issues.
=============== Diff against Kernel-eem.886 ===============
Item was changed:
----- Method: ContextPart>>methodClass (in category 'debugger access') -----
methodClass
"Answer the class in which the receiver's method was found."
+ ^self method methodClass ifNil: [self objectClass: self receiver].!
- ^self method methodClass ifNil:[self receiver class].!
Item was changed:
----- Method: ContextPart>>print:on: (in category 'debugger access') -----
print: anObject on: aStream
+ "Safely print anObject in the face of direct ProtoObject subclasses."
+ | objClass title |
+ objClass := self objectClass: anObject.
+ (objClass canUnderstand: #printOn:) ifTrue:
+ [^anObject printOn: aStream].
+ title := objClass name.
- "Safely print anObject in the face of direct ProtoObject subclasses"
- | title |
- (anObject class canUnderstand: #printOn:)
- ifTrue:[^anObject printOn: aStream].
- title := anObject class name.
aStream
nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']);
nextPutAll: title!
Item was changed:
----- Method: ContextPart>>selectorCategory (in category 'accessing') -----
selectorCategory
+ "Answer the category to which this message belongs (relative to the receiver).
+ If no superclass categorises this message, use the default."
+ | rcvrClass organizers |
+ rcvrClass := self objectClass: self receiver.
+ organizers := rcvrClass withAllSuperclasses collect: [:ea | ea organization].
+ organizers addFirst: rcvrClass organization.
+ ^(organizers collect: [ :org | org categoryOfElement: self selector])
+ detect: [:ea | ea ~= ClassOrganizer default and: [ea ~= nil]]
- "Return the category to which this message belongs (relative to the receiver). If no superclass categorises this message, use the default."
- | organizers |
- organizers := self receiver class withAllSuperclasses collect: [:ea | ea organization].
- organizers addFirst: self receiver class organization.
- ^ (organizers collect: [ :org | org categoryOfElement: self selector])
- detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
ifNone: [ClassOrganizer default]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.887.mcz
==================== Summary ====================
Name: Kernel-eem.887
Author: eem
Time: 27 November 2014, 1:19:50.961 pm
UUID: 888d2632-2d0a-49dd-b83a-b5aceb2c939d
Ancestors: Kernel-eem.886
A few more cases in COntextPart where objectClass:
should be used instead of class to avoid proxy issues.
=============== Diff against Kernel-eem.886 ===============
Item was changed:
----- Method: ContextPart>>methodClass (in category 'debugger access') -----
methodClass
"Answer the class in which the receiver's method was found."
+ ^self method methodClass ifNil: [self objectClass: self receiver].!
- ^self method methodClass ifNil:[self receiver class].!
Item was changed:
----- Method: ContextPart>>print:on: (in category 'debugger access') -----
print: anObject on: aStream
+ "Safely print anObject in the face of direct ProtoObject subclasses."
+ | objClass title |
+ objClass := self objectClass: anObject.
+ (objClass canUnderstand: #printOn:) ifTrue:
+ [^anObject printOn: aStream].
+ title := objClass name.
- "Safely print anObject in the face of direct ProtoObject subclasses"
- | title |
- (anObject class canUnderstand: #printOn:)
- ifTrue:[^anObject printOn: aStream].
- title := anObject class name.
aStream
nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']);
nextPutAll: title!
Item was changed:
----- Method: ContextPart>>selectorCategory (in category 'accessing') -----
selectorCategory
+ "Answer the category to which this message belongs (relative to the receiver).
+ If no superclass categorises this message, use the default."
+ | rcvrClass organizers |
+ rcvrClass := self objectClass: self receiver.
+ organizers := rcvrClass withAllSuperclasses collect: [:ea | ea organization].
+ organizers addFirst: rcvrClass organization.
+ ^(organizers collect: [ :org | org categoryOfElement: self selector])
+ detect: [:ea | ea ~= ClassOrganizer default and: [ea ~= nil]]
- "Return the category to which this message belongs (relative to the receiver). If no superclass categorises this message, use the default."
- | organizers |
- organizers := self receiver class withAllSuperclasses collect: [:ea | ea organization].
- organizers addFirst: self receiver class organization.
- ^ (organizers collect: [ :org | org categoryOfElement: self selector])
- detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
ifNone: [ClassOrganizer default]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.887.mcz
==================== Summary ====================
Name: Kernel-eem.887
Author: eem
Time: 27 November 2014, 1:19:50.961 pm
UUID: 888d2632-2d0a-49dd-b83a-b5aceb2c939d
Ancestors: Kernel-eem.886
A few more cases in COntextPart where objectClass:
should be used instead of class to avoid proxy issues.
=============== Diff against Kernel-eem.886 ===============
Item was changed:
----- Method: ContextPart>>methodClass (in category 'debugger access') -----
methodClass
"Answer the class in which the receiver's method was found."
+ ^self method methodClass ifNil: [self objectClass: self receiver].!
- ^self method methodClass ifNil:[self receiver class].!
Item was changed:
----- Method: ContextPart>>print:on: (in category 'debugger access') -----
print: anObject on: aStream
+ "Safely print anObject in the face of direct ProtoObject subclasses."
+ | objClass title |
+ objClass := self objectClass: anObject.
+ (objClass canUnderstand: #printOn:) ifTrue:
+ [^anObject printOn: aStream].
+ title := objClass name.
- "Safely print anObject in the face of direct ProtoObject subclasses"
- | title |
- (anObject class canUnderstand: #printOn:)
- ifTrue:[^anObject printOn: aStream].
- title := anObject class name.
aStream
nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']);
nextPutAll: title!
Item was changed:
----- Method: ContextPart>>selectorCategory (in category 'accessing') -----
selectorCategory
+ "Answer the category to which this message belongs (relative to the receiver).
+ If no superclass categorises this message, use the default."
+ | rcvrClass organizers |
+ rcvrClass := self objectClass: self receiver.
+ organizers := rcvrClass withAllSuperclasses collect: [:ea | ea organization].
+ organizers addFirst: rcvrClass organization.
+ ^(organizers collect: [ :org | org categoryOfElement: self selector])
+ detect: [:ea | ea ~= ClassOrganizer default and: [ea ~= nil]]
- "Return the category to which this message belongs (relative to the receiver). If no superclass categorises this message, use the default."
- | organizers |
- organizers := self receiver class withAllSuperclasses collect: [:ea | ea organization].
- organizers addFirst: self receiver class organization.
- ^ (organizers collect: [ :org | org categoryOfElement: self selector])
- detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
ifNone: [ClassOrganizer default]!
Eliot Miranda uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-eem.282.mcz
==================== Summary ====================
Name: KernelTests-eem.282
Author: eem
Time: 22 November 2014, 7:59:02.387 am
UUID: ba4a5d95-b7b2-48b8-a482-bc6d3262016b
Ancestors: KernelTests-dtl.281
Use isFloat instead of class == Float
=============== Diff against KernelTests-dtl.281 ===============
Item was changed:
----- Method: IntegerTest>>testBigReceiverInexactNthRoot (in category 'tests - mathematical functions') -----
testBigReceiverInexactNthRoot
"
IntegerTest new testBigReceiverInexactNthRoot
"
"Inexact 3rd root (not a whole cube number), so a Float must be answered.
However, receiver is too big for Float arithmethic."
| bigNum result |
bigNum := (100 factorial raisedTo: 3) + 1. "Add 1 so it is not a whole cube"
self assert: bigNum asFloat isInfinite. "Otherwise, we chose a bad sample"
result := bigNum nthRoot: 3.
+ self assert: result isFloat.
- self assert: result class == Float.
self deny: result isInfinite.
self assert: result = 100 factorial asFloat. "No other float is closer. See following line"
self assert: 100 factorial asFloat = (100 factorial+1) asFloat!
Item was changed:
----- Method: IntegerTest>>testBigReceiverInexactSqrt (in category 'tests - mathematical functions') -----
testBigReceiverInexactSqrt
"
IntegerTest new testBigReceiverInexactSqrt
"
"Inexact 3rd root (not a whole cube number), so a Float must be answered.
However, receiver is too big for Float arithmethic."
| bigNum result |
bigNum := 100 factorial squared + 1. "Add 1 so it is not a whole square"
self assert: bigNum asFloat isInfinite. "Otherwise, we chose a bad sample"
result := bigNum sqrt.
+ self assert: result isFloat.
- self assert: result class == Float.
self deny: result isInfinite.
self assert: result = 100 factorial asFloat. "No other float is closer. See following lines"
self assert: (result successor asFraction squared - bigNum) abs >= (result asFraction squared - bigNum) abs.
+ self assert: (result predecessor asFraction squared - bigNum) abs >= (result asFraction squared - bigNum) abs!
- self assert: (result predecessor asFraction squared - bigNum) abs >= (result asFraction squared - bigNum) abs.!
Item was changed:
----- Method: ScaledDecimalTest>>testInexactNthRoot (in category 'tests') -----
testInexactNthRoot
| tenth cubicRoot3 fifthRootTenth three |
three := 3.0s1.
cubicRoot3 := three raisedTo: 1/3.
+ self assert: cubicRoot3 isFloat.
- self assert: cubicRoot3 class = Float.
self deny: cubicRoot3 squared = 3.
tenth := 0.10s2.
fifthRootTenth := tenth raisedTo: 1/5.
+ self assert: fifthRootTenth isFloat.
+ self deny: fifthRootTenth squared = tenth!
- self assert: fifthRootTenth class = Float.
- self deny: fifthRootTenth squared = tenth.!
Item was changed:
----- Method: ScaledDecimalTest>>testInexactSqrt (in category 'tests') -----
testInexactSqrt
| tenth sqrt3 sqrtTenth three |
three := 3.0s1.
sqrt3 := three sqrt.
+ self assert: sqrt3 isFloat.
- self assert: sqrt3 class = Float.
self deny: sqrt3 squared = 3.
tenth := 0.10s2.
sqrtTenth := tenth sqrt.
+ self assert: sqrtTenth isFloat.
+ self deny: sqrtTenth squared = tenth!
- self assert: sqrtTenth class = Float.
- self deny: sqrtTenth squared = tenth.!