Please don't use deepCopy here; it copies too much data from the
original tree. collect: [:node | node copy] does exactly the right
thing in both the single-node and node-collection cases.
No, it does exactly the same:
deepCopy
"Returns a deep copy of the receiver (the instance variables are
copies of the receiver's instance variables)"
| class aCopy num |
class := self class.
aCopy := self shallowCopy.
class isPointers
ifTrue: [ num := class instSize + self basicSize ]
ifFalse: [ num := class instSize ].
" copy the instance variables (if any) "
1 to: num do: [ :i |
aCopy instVarAt: i put: (self instVarAt: i) copy.
].
^aCopy
! !
+visitNodes: aNodeList
+ ^self visitNodes: aNodeList searches: searches onMatch: [:newNodes |]!
Why does this inline visitNodes:onMatch:? (As with visitArguments:.)
Just because, I'll undo this inlining.
Thanks,
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk