Re: [RFC] Stringify a thread

[email protected] (John Peacock) Thu, 05 Oct 2006 15:02:23 -0400
Newsgroups perl.perl5.porters,perl.ithreads
Organization Rowman & Littlefield Publishing Group
Message-ID <[email protected]>
Jim Bodwin wrote:
> 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.

Yeah, that's really going to bring on the 'backwards compatibility 
police' as a *big* change in behavior.  You can't just make stuff up 
like that cause you feel like it. ;-)

I spent close to two years spelunking inside the Perl core and 
documenting how overloading functions in XS.  Perl objects are the 
references to other things, not the other things themselves (i.e. 
blessing an anonymous hash makes an object, but the hash is still just a 
hash).

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748