[squeak-dev] The Inbox: Kernel-ct.1293.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 8 10:11:31 UTC 2020


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1293.mcz

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

Name: Kernel-ct.1293
Author: ct
Time: 8 January 2020, 11:11:21.431206 am
UUID: 86f4d70b-c53c-5a45-97f3-1bff2d65cdb4
Ancestors: Kernel-nice.1292

Elaborate method comment in Object >> #copyFrom:

=============== Diff against Kernel-nice.1292 ===============

Item was changed:
  ----- Method: Object>>copyFrom: (in category 'copying') -----
  copyFrom: anotherObject
+ 	"Copy to myself all instance variables I have in common with anotherObject, i. e. those which have the same index in both class definitions. This is dangerous because it ignores an object's control over its own inst vars."
- 	"Copy to myself all instance variables I have in common with anotherObject.  This is dangerous because it ignores an object's control over its own inst vars.  "
  
  	| mine his |
  	<primitive: 168>
  	mine := self class allInstVarNames.
  	his := anotherObject class allInstVarNames.
  	1 to: (mine size min: his size) do: [:ind |
  		(mine at: ind) = (his at: ind) ifTrue: [
  			self instVarAt: ind put: (anotherObject instVarAt: ind)]].
  	self class isVariable & anotherObject class isVariable ifTrue: [
  		1 to: (self basicSize min: anotherObject basicSize) do: [:ind |
  			self basicAt: ind put: (anotherObject basicAt: ind)]].!

Item was changed:
  ----- Method: Object>>copySameFrom: (in category 'copying') -----
  copySameFrom: otherObject
+ 	"Copy to myself all instance variables named the same in otherObject. This is dangerous because it ignores an object's control over its own inst vars."
- 	"Copy to myself all instance variables named the same in otherObject.
- 	This ignores otherObject's control over its own inst vars."
  
  	| myInstVars otherInstVars |
  	myInstVars := self class allInstVarNames.
  	otherInstVars := otherObject class allInstVarNames.
  	myInstVars doWithIndex: [:each :index |
  		| match |
  		(match := otherInstVars indexOf: each) > 0 ifTrue:
  			[self instVarAt: index put: (otherObject instVarAt: match)]].
  	1 to: (self basicSize min: otherObject basicSize) do: [:i |
  		self basicAt: i put: (otherObject basicAt: i)].
  !



More information about the Squeak-dev mailing list