[squeak-dev] The Trunk: Kernel-nice.613.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 28 22:21:19 UTC 2011


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

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

Name: Kernel-nice.613
Author: nice
Time: 29 August 2011, 12:20:33.523 am
UUID: c5ac2f0a-3419-41d9-a4e5-0331ff55467d
Ancestors: Kernel-cmm.612

Don't provide separate setters for Complex #real: and #imaginary: parts.
Instead, provide a single #real:imaginary: initializer, that's faster and safer (like Magnitude, Complex numbers might be shared and it would be dangerous to modify a Complex in place).

=============== Diff against Kernel-cmm.612 ===============

Item was changed:
  ----- Method: Complex class>>real:imaginary: (in category 'instance creation') -----
  real: aNumber1 imaginary: aNumber2
+ 	^self basicNew	real: aNumber1 imaginary: aNumber2!
- 	| newComplex |
- 	newComplex := super new.
- 	newComplex
- 		real: aNumber1;
- 		imaginary: aNumber2.
- 	^ newComplex!

Item was removed:
- ----- Method: Complex>>imaginary: (in category 'private') -----
- imaginary: aNumber
- 	imaginary := aNumber.!

Item was removed:
- ----- Method: Complex>>real: (in category 'private') -----
- real: aNumber
- 	real := aNumber.!

Item was added:
+ ----- Method: Complex>>real:imaginary: (in category 'private') -----
+ real: aNumber1 imaginary: aNumber2
+ 	"Private - initialize the real and imaginary parts of a Complex"
+ 	real := aNumber1.
+ 	imaginary := aNumber2.!




More information about the Squeak-dev mailing list