Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Simple question about Inside-Out objects

by Anno (Deacon)
on Mar 13, 2007 at 17:54 UTC ( #604631=note: print w/ replies, xml ) Need Help??


in reply to Simple question about Inside-Out objects

refaddr()is used to be entirely agnostic about the bless status of an object.

It is essential for an inside-out class that an object keep its identity whether it is unblessed, blessed or re-blessed. Not to mention possible overloading of stringification.

Anno


Comment on Re: Simple question about Inside-Out objects
Download Code
Re^2: Simple question about Inside-Out objects
by blazar (Canon) on Mar 13, 2007 at 20:10 UTC
    refaddr() is used to be entirely agnostic about the bless status of an object.

    Speaking of which (and I'm replying to you but ideally to all those who kindly answered my question, whom I thank), I was thinking that perhaps it would be nice if standard ref, just like so many functions, returned something different in list context, i.e. something like: REF, ADDR, BLESSED, where

    • REF would be ref()'s current output if the reference is not blessed, and if it is then the same as if it were not,
    • ADDR the same as refaddr()'s and
    • BLESSED the package the reference is blessed in, if it is, or undef otherwise.

    But I suppose that such a beast would risk of breaking too much existing code...

      Interestingly enough... UNIVERSAL::ref would allow you to override ref for some objects. There's no such thing as ref() in list context right now though.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://604631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-08-21 02:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls