Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Replacing objects

by sundialsvc4 (Abbot)
on Dec 19, 2013 at 00:39 UTC ( #1067752=note: print w/replies, xml ) Need Help??

in reply to Replacing objects

The superficial answer, to your immediate question, is (of course) “yes.”

By that I mean:   the bless() primitive (simply...) associates a particular class/object definition with a particular object-instance, such that the runtime interpreter, when presented with a “method-call,” will use that particular association in its effort to resolve the call.   Therefore, “yes... it is technically possible to, on-the-fly, change that association, just by calling bless() again.”

But, now, the “XY Problem” Question ...   What, exactly, are you trying to accomplish here?   (Hey, haven’t we a-l-l been in this very spot?)   A thing that “technically speaking, the interpreter ‘allows” you to do,” might or might not be the best ‘There’s More Than One Way To™’ way to do it, but “by now, we’re just too damm close to it.”   Therefore, please tell us more about your ultimate goal, so that The Peanut Gallery might assist you in assessing whether the Tree that you are currently barking up, really is the right Tree.   Perhaps there is another, better, “way to do it.”   :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067752]
[Corion]: Ouch. I just learned something about Chrome - the "version numbers" are not really feature numbers... Chrome 62 still gets new features even though Chrome 64 is out and Chrome 65 is the dev version
[erix]: why ouch? Something to be said for that ,surely?
LanX is a dev version
[marto]: That reminds me, I made some notes somewhere with regard W::M::C, I'll get round to a PR when I've time to flesh it out

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2017-12-12 20:11 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (335 votes). Check out past polls.