Re: [RFC] Stringify a thread

[email protected] (Jim Bodwin) Thu, 05 Oct 2006 11:56:16 -0700
Newsgroups perl.perl5.porters,perl.ithreads
Message-ID <[email protected]>

John Peacock wrote:
>
> Yes, overloading allows me, as a class author, full freedom to decide 
> how my object will behave in different situations.  It has nothing 
> whatsoever to do with the behavior of well-behaved introspection tools:

On further thought, I'll claim that putting the following to overload 
stringification for a class:

   '""' => sub { shift->tid() }

should affect the behavior of $$ref and not $ref.  That is, the thing 
being overloaded is the class and not the reference so "$ref" should 
continue to do what the "reference" type says that stringification 
should do (that is, return the referenced class name plus unique id) 
while "$$ref" should use the stringification rule for the class that is 
being referenced.

  - Jim