[squeak-dev] The Trunk: Kernel-eem.621.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Sep 16 17:44:19 UTC 2011
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.621.mcz
==================== Summary ====================
Name: Kernel-eem.621
Author: eem
Time: 16 September 2011, 10:43:29.034 am
UUID: 7946debc-5642-4f36-8cce-927c855d3e9e
Ancestors: Kernel-eem.620
Make AdditionalMethodState>copyWith:/copyWithout: subclass-
friendly, copying all inst vars.
Also make then shallowCopy pragmas and associations to
produce distinct copies.
=============== Diff against Kernel-eem.620 ===============
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.'].
copy := self class new: (bs := self basicSize) + 1.
1 to: bs do:
[:i|
+ copy basicAt: i put: (self basicAt: i) shallowCopy].
- copy basicAt: i put: (self basicAt: i)].
copy basicAt: bs + 1 put: aPropertyOrPragma.
+ 1 to: self class instSize do:
+ [:i| copy instVarAt: i put: (self instVarAt: i)].
+ ^copy!
- ^copy
- selector: selector;
- setMethod: method;
- yourself
- !
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 |
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!
- ifFalse: [copy basicAt: i - offset put: (self basicAt: i)]].
- ^copy
- selector: selector;
- setMethod: method;
- yourself
- !
More information about the Squeak-dev
mailing list
|