Re: Object Identification Cold War and the return of autobox.pm (wasRe: UNIVERSAL::ref might make ref( $mocked_obj ) sane)

2007-03-02 Thread demerphq
On 3/2/07, Adam Kennedy [EMAIL PROTECTED] wrote: 99.999% of the time you do not want to really know how something is implemented, you want to remain ignorant. I concur, which is what really pisses me off them IO::String-new(\$string)-isa('IO::Handle') returns false, because the author

Re: Object Identification Cold War and the return of autobox.pm (wasRe: UNIVERSAL::ref might make ref( $mocked_obj ) sane)

2007-03-02 Thread chromatic
On Friday 02 March 2007 00:53, demerphq wrote: *snip good discussion* Now if there was an -implements() utility function as well as the -isa() funcation, then I think IO::Handle would contrive to ensure that IO::String-new(\$string)-implements('IO::Handle') would return true even though

Re: Object Identification Cold War and the return of autobox.pm (wasRe: UNIVERSAL::ref might make ref( $mocked_obj ) sane)

2007-03-02 Thread Adrian Howard
On 2 Mar 2007, at 00:35, Adam Kennedy wrote: [snip] Well, except you aren't supposed to do that, because if -isa can be overloaded, it can also die or throw an exception. So eval { $obj-isa($class) } falsely ignores errors. [snip] That, of course, depends on whether you want to ignore

Re: Object Identification Cold War and the return of autobox.pm (wasRe: UNIVERSAL::ref might make ref( $mocked_obj ) sane)

2007-03-02 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Moin. On Friday 02 March 2007 08:53:43 demerphq wrote: On 3/2/07, Adam Kennedy [EMAIL PROTECTED] wrote: 99.999% of the time you do not want to really know how something is implemented, you want to remain ignorant. I concur, which is what

Re: Object Identification Cold War and the return of autobox.pm (wasRe: UNIVERSAL::ref might make ref( $mocked_obj ) sane)

2007-03-01 Thread Adam Kennedy
Michael G Schwern wrote: Yuval Kogman wrote: Likewise with ref in boolean context, I almost never want the object to be able to lie to me. But if it has to work hard to lie, then does it matter? Yeah, I'm with Yuval here. There seem to be a cold war going on here wrt identifying an object.

Re: Object Identification Cold War and the return of autobox.pm (wasRe: UNIVERSAL::ref might make ref( $mocked_obj ) sane)

2007-03-01 Thread Michael G Schwern
Adam Kennedy wrote: IT SHOULD NOT BE THIS COMPLICATED TO IDENTIFY THE HERITAGE OF AN OBJECT! use Params::Util '_INSTANCE'; if ( _INSTANCE($obj, 'Whatever') ) { } Oh good, depend on another module to implement a basic language feature. (I appreciate your suggestion but I'm LAMENTING