Stephen Compall wrote:
On Tue, 2007-05-22 at 10:17 +0200, Paolo Bonzini wrote:
-           newValue := oldContext at: key put: value "deepCopy <<<".
+           newValue := oldContext at: key put: value deepCopy "<<<".

Quick postscript on this: I originally used `value collect: [:each |
each copy]' instead of deepCopy because value may be a node instead of a
list of nodes.  (RBProgramNode has 'collect: aBlock  ^aBlock value:
self'.)  So deepCopy copies the 'parent' instvar, which copies the value
and everything else in its tree.


Thanks for the explanation.  I added instead this one:

--- orig/compiler/RBParseNodes.st
+++ mod/compiler/RBParseNodes.st
@@ -253,6 +253,13 @@ nodesDo: aBlock

 !RBProgramNode methodsFor: 'enumeration'!

+deepCopy
+    "Hacked to fit collection protocols.  We use #deepCopy to obtain a list
+     of copied nodes.  We do already copy for our instance variables
+     through #postCopy, so we redirect #deepCopy to be a normal #copy."
+
+    ^self copy
+
 collect: aBlock
     "Hacked to fit collection protocols"


Thanks again for contributing these tests and bug fixes. I will contact other people I know that work on the refactoring browser in order to have them merged.

Paolo



_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to