[Pkg] The Trunk: Kernel-eem.623.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Sep 16 18:28:41 UTC 2011


Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.623.mcz

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

Name: Kernel-eem.623
Author: eem
Time: 16 September 2011, 11:28:02.425 am
UUID: b73bf0f2-ed5e-4081-953c-05e68c29cd89
Ancestors: Kernel-eem.622

Get use of new: and basicNew: in AdditionalMethiodState
correct (for convenience of subclasses).

=============== Diff against Kernel-eem.622 ===============

Item was changed:
  ----- Method: AdditionalMethodState class>>forMethod:selector: (in category 'instance creation') -----
  forMethod: aMethod selector: aSelector
+ 	^(self new: 0)
- 	^(self basicNew: 0)
  		selector: aSelector;
  		setMethod: aMethod;
  		yourself!

Item was changed:
  ----- Method: AdditionalMethodState class>>selector:with: (in category 'instance creation') -----
  selector: aSelector with: aPropertyOrPragma
+ 	^(self new: 1)
- 	^(self basicNew: 1)
  		selector: aSelector;
  		basicAt: 1 put: aPropertyOrPragma;
  		yourself!

Item was changed:
  ----- Method: AdditionalMethodState>>copyWith: (in category 'copying') -----
  copyWith: aPropertyOrPragma "<Association|Pragma>"
  	"Answer a copy of the receiver which includes aPropertyOrPragma"
  	| bs copy |
  	(Association == aPropertyOrPragma class
  	 or: [Pragma == aPropertyOrPragma class]) ifFalse:
  		[self error: self class name, ' instances should hold only Associations or Pragmas.'].
+ 	"no need to initialize here; we're copying all inst vars"
+ 	copy := self class basicNew: (bs := self basicSize) + 1.
- 	copy := self class new: (bs := self basicSize) + 1.
  	1 to: bs do:
  		[:i|
  		copy basicAt: i put: (self basicAt: i) shallowCopy].
  	copy basicAt: bs + 1 put: aPropertyOrPragma.
  	1 to: self class instSize do:
  		[:i| copy instVarAt: i put: (self instVarAt: i)].
  	^copy!

Item was changed:
  ----- Method: AdditionalMethodState>>copyWithout: (in category 'copying') -----
  copyWithout: aPropertyOrPragma "<Association|Pragma>"
  	"Answer a copy of the receiver which no longer includes aPropertyOrPragma"
  	| bs copy offset |
+ 	"no need to initialize here; we're copying all inst vars"
+ 	copy := self class basicNew: (bs := self basicSize) - ((self includes: aPropertyOrPragma)
+ 															ifTrue: [1]
+ 															ifFalse: [0]).
- 	copy := self class new: (bs := self basicSize) - ((self includes: aPropertyOrPragma)
- 													ifTrue: [1]
- 													ifFalse: [0]).
  	offset := 0.
  	1 to: bs do:
  		[:i|
  		(self basicAt: i) = aPropertyOrPragma
  			ifTrue: [offset := 1]
  			ifFalse: [copy basicAt: i - offset put: (self basicAt: i) shallowCopy]].
  	1 to: self class instSize do:
  		[:i| copy instVarAt: i put: (self instVarAt: i)].
  	^copy!



More information about the Packages mailing list