Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Stevan Little
Hello all. In the processing of working with mugwump's shiny new perl6 OO Set.pm. I realized that we do not currently have a way to uniquely identify objects in Pugs like the way we have in perl5 (object stringification). So I asked Autrijus, and he promptly implemented a rudimentary object num

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Yuval Kogman
On Fri, May 13, 2005 at 21:47:52 -0400, Stevan Little wrote: > Hello all. > > In the processing of working with mugwump's shiny new perl6 OO Set.pm. I > realized that we > do not currently have a way to uniquely identify objects in Pugs like the way > we have in > perl5 (object stringification

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 09:47:52PM -0400, Stevan Little wrote: : Hello all. : : In the processing of working with mugwump's shiny new perl6 OO Set.pm. : I realized that we do not currently have a way to uniquely identify : objects in Pugs like the way we have in perl5 (object stringification).

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Autrijus Tang
On Fri, May 13, 2005 at 07:28:03PM -0700, Larry Wall wrote: > That's what .id is supposed to do, without the bogus numorstringification > semantics. It should return something opaque that matches with ~~. Okay, implemented as such. What does unboxed values return for their "id", though? 3 =

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Larry Wall
On Sat, May 14, 2005 at 10:54:34AM +0800, Autrijus Tang wrote: : On Fri, May 13, 2005 at 07:28:03PM -0700, Larry Wall wrote: : > That's what .id is supposed to do, without the bogus numorstringification : > semantics. It should return something opaque that matches with ~~. : : Okay, implemented a

Re: Object Numify/Stringify-ing to Unique values

2005-05-14 Thread Leopold Toetsch
Autrijus Tang <[EMAIL PROTECTED]> wrote: > What does unboxed values return for their "id", though? > 3 =:= 3; # always true? > 3.id ~~ 3.id; # ditto? Maybe true or not, that's highly implementation dependent. I'd not touch these internals: $ python Python 2.4 [...] >>> id(2) ==

Re: Object Numify/Stringify-ing to Unique values

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 02:57:53PM +0200, Leopold Toetsch wrote: : If we want some interoperbility with Python dicts, hashing will not be : done on ids but on the hash function of the type. Which Perl could default to id. Larry