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.

The duplicate tree becomes garbage once the copied node is inserted back
into the original tree, but I thought it was worth avoiding anyway.  In
very rare cases, copying the parent's tree might cause problems with
rewriters computed under #recusivelySearchInContext.

-- 
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
Failure to imagine vast possibilities usually stems from a lack of
imagination, not a lack of possibility.

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to