Finding all references to an object
I have an object, which I want to replace with a new object everywhere it exists in the system. How do I do that? Thanks. Sean -- View this message in context: http://forum.world.st/Finding-all-references-to-an-object-tp3714218p3714218.... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
becomeForward: ? On Aug 2, 2011, at 11:04 PM, Sean P. DeNigris wrote:
I have an object, which I want to replace with a new object everywhere it exists in the system. How do I do that?
Thanks. Sean
-- View this message in context: http://forum.world.st/Finding-all-references-to-an-object-tp3714218p3714218.... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Pat Maddox-3 wrote:
becomeForward: ?
Looks good, but what's the difference between become: and becomeForward: ? -- View this message in context: http://forum.world.st/Finding-all-references-to-an-object-tp3714218p3714230.... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
On Aug 2, 2011, at 11:14 PM, Sean P. DeNigris wrote:
Pat Maddox-3 wrote:
becomeForward: ?
Looks good, but what's the difference between become: and becomeForward: ?
become: swaps the two objects entirely, becomeForward: "replaces" references with the argument. Check out the comments. But a basic example would be... | a b | a := 'foo'. b := 'foobar'. a becomeForward: b. "a = 'foobar' b = 'foobar'" | a b | a := 'foo'. b := 'foobar'. a become: b. "a = 'foobar' b = 'foo'"
Pat Maddox-3 wrote:
become: swaps the two objects entirely, becomeForward: "replaces" references with the argument.
Got it, thanks. The system tests (duh) for these are really clear. -- View this message in context: http://forum.world.st/Finding-all-references-to-an-object-tp3714218p3714269.... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
On Aug 2, 2011, at 11:40 PM, Sean P. DeNigris wrote:
Pat Maddox-3 wrote:
become: swaps the two objects entirely, becomeForward: "replaces" references with the argument.
Got it, thanks. The system tests (duh) for these are really clear.
it's generally better to use becomeForward: unless you have a really good reason to use become: and it's generally better to use anything other than becomeForward: if you can. It's what dubya would call "the nukular opshin"
participants (2)
-
Pat Maddox -
Sean P. DeNigris