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). > > So I asked Autrijus, and he promptly implemented a rudimentary object > numification > scheme, and requested I query the @Larry as to how this should really behave.
I think numification and stringification has given us lots of unnecessary pain in p5. Look at all the broken modules which need to be using Tie::RefHash or Set::Object but don't. overload::StrVal($obj) is annoying to type, and annoying to read. It's defensive programming that should have nicer means builtin to the language. Furthermore, reliable, 100% correct (always) behavior should be easier to do than broken behavior that seems OK, so that people don't use it when they aren't future-proofing. Overloading operators are there to allow us to pretend objects really are the things they represent, for equality, printing, and whatnot. This is something else, and does not have to do with the fact that the object is a perl object, a part of the data that the language offers us. This has to do with the meaning we put into the building blocks. I think this should not be a behavior of the data, but something returned from a meta method. I'd like to be able to say $obj.meta.id Or something with a similar meaning, but in a more concise way. Perhaps an operator with ':' in it would be suitable. -- () Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418 perl hacker & /\ kung foo master: /me climbs a brick wall with his fingers: neeyah!
pgpkmGVh4YiJv.pgp
Description: PGP signature