Le 05/11/2014 18:04, Mark Rizun a écrit :
Hi everyone,
I want to get a deep copy of ast. But deepCopy doesn't work:)
What I mean:
| ast1 ast2 |
ast1 := RBParser parseRewriteExpression: 'self'.
ast2 := ast1 copy."or without copy"
ast1 stop: 99.
ast2 stop
When evaluate this you get 99. I want it to be 4.
So I want to have separate object ast2 with separate data, not depending
on changes made in ast1.
As I said deepCopy doesn't work. Any ideas?
I'd say beware. Deep copying ASTs is hard. You'll need to characterize a
bit better what has been copied with deepCopy and what hasn't before
starting to hack it.
Thierry
Thanks,
Mark