<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi all,</p>
<p><br>
</p>
<p>I don't get the actual difference between #copyFrom: and #copySameFrom:.</p>
<p><br>
</p>
<p>The latter looks more "modern" to me, as it uses a primitive and has several implementors.</p>
<p>In my opinion, none of them actually matches its description ("<span>Copy to myself all instance variables [named the same in | <span>I have in common with]</span> otherObject"). The following leaves o2 empty:</span></p>
<p><br>
</p>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<p></p>
<div></div>
<p></p>
<div>c1 := Object newUniqueClassInstVars: 'foo bar' classInstVars: ''.</div>
<div>c2 := Object newUniqueClassInstVars: 'bar foo' classInstVars: ''.</div>
<div>o1 := c1 new</div>
<div><span style="white-space:pre"></span>instVarNamed: #foo put: 6;</div>
<div><span style="white-space:pre"></span>instVarNamed: #bar put: 7.</div>
<div>o2 := o1 as: c2.</div>
<div>o2 instVarAt: 1 "nil".</div>
<div><br>
</div>
<div>o2 copySameFrom: o1.</div>
<div>o2 instVarAt: 1 "nil".</div>
<p></p>
<div></div>
<p></p>
</blockquote>
<p></p>
<div></div>
<div><br>
</div>
<div>Question: Could we deprecate #copySameFrom:, and in #copyFrom:, copy *all* matching instvars without respecting their order? Or did I miss any intended difference in behavior?</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
</body>
</html>