The Trunk: Kernel-nice.1101.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-nice.1101.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1101.mcz

==================== Summary ====================

Name: Kernel-nice.1101
Author: nice
Time: 26 April 2017, 11:32:58.822457 pm
UUID: e7668d92-95a7-4ece-967a-35a6bf61c946
Ancestors: Kernel-eem.1100

Fix the dividend of ZeroDivide exception in case of reciprocal.

Classify a few 'as yet unclassified' methods.

=============== Diff against Kernel-eem.1100 ===============

Item was changed:
+ ----- Method: ClassCommentReader>>scanFrom: (in category 'filein/Out') -----
- ----- Method: ClassCommentReader>>scanFrom: (in category 'as yet unclassified') -----
  scanFrom: aStream
  "File in the class comment from aStream.  Not string-i-fied, just a text, exactly as it is in the browser.  Move to changes file."
 
  class theNonMetaClass classComment: (aStream nextChunkText) stamp: changeStamp
  "Writes it on the disk and saves a RemoteString ref"!

Item was changed:
+ ----- Method: ClassCommentReader>>scanFrom:environment: (in category 'filein/Out') -----
- ----- Method: ClassCommentReader>>scanFrom:environment: (in category 'as yet unclassified') -----
  scanFrom: aStream environment: anEnvironment
  ^ self scanFrom: aStream!

Item was changed:
+ ----- Method: ClassCommentReader>>scanFromNoCompile: (in category 'filein/Out') -----
- ----- Method: ClassCommentReader>>scanFromNoCompile: (in category 'as yet unclassified') -----
  scanFromNoCompile: aStream
  "File in the class comment from aStream.  Not string-i-fied, just a text, exactly as it is in the browser.  Move to changes file."
 
  self scanFrom: aStream. "for comments, the same as usual"!

Item was changed:
  ----- Method: Complex>>reciprocal (in category 'arithmetic') -----
  reciprocal
  "Answer 1 divided by the receiver. Create an error notification if the
  receiver is 0."
 
  self = 0
+ ifTrue: [^ (ZeroDivide dividend: 1) signal]
- ifTrue: [^ (ZeroDivide dividend: self) signal]
  ifFalse: [^1 / self]
  !

Item was changed:
+ ----- Method: Error>>defaultAction (in category 'handling') -----
- ----- Method: Error>>defaultAction (in category 'exceptionDescription') -----
  defaultAction
  "No one has handled this error, but now give them a chance to decide how to debug it.  If none handle this either then open debugger (see UnhandedError-defaultAction)"
 
  UnhandledError signalForException: self!

Item was changed:
  ----- Method: Number>>raisedTo: (in category 'mathematical functions') -----
  raisedTo: aNumber
  "Answer the receiver raised to aNumber."
 
  aNumber isInteger ifTrue: [
  "Do the special case of integer power"
  ^ self raisedToInteger: aNumber].
  aNumber isFraction ifTrue: [
  "Special case for fraction power"
  ^ (self nthRoot: aNumber denominator) raisedToInteger: aNumber numerator ].
  self negative ifTrue: [
  ^ ArithmeticError signal: 'Negative numbers can''t be raised to float powers.' ].
  aNumber isZero ifTrue: [^ self class one]. "Special case of exponent=0"
  1 = aNumber ifTrue: [^ self]. "Special case of exponent=1"
  self isZero ifTrue: [ "Special case of self = 0"
  aNumber negative
+ ifTrue: [^ (ZeroDivide dividend: 1) signal]
- ifTrue: [^ (ZeroDivide dividend: self) signal]
  ifFalse: [^ self]].
  ^ (aNumber * self ln) exp "Otherwise use logarithms"!