On Sun, 06 Aug 2000 16:43:36 -0700, Peter Scott wrote (in part):
Peter> Call me old-fashioned, but I don't see what's wrong with
Peter> use overload '""' => sub { $_[0]->to_string };
Peter> for anything that wants to take such a relatively odd
Peter> action.
Larry's commented (in p5p) on his own experience in trying to
have properly "stringified" objects. He wound up with a bunc of
classes doing exactly what you suggest, which is using the
existing overload mechanism *for just that one operation*. He
speculated then that this particular one might be at the wrong
level -- it might be a candidate for being made easier.
That said, if we do this, I think that the implicitly-consulted
method should follow the "parts of speech" rule that someone
(TomC?) listed. Paraphrased: "A method is a function is a
subroutine is an action should be a verb." I nominate
->STRINGIFY. It's a verb, even though it's a neologism, and it's
handier to type than the equivalent ->MAKE_STRING would be. It's
also sufficiently mnemonic for those of us who've read the
existing Perl documentation and know what "$thing" does.
--
Spider Boardman (at home) [EMAIL PROTECTED]
The management (my cats) made me say this. http://www.ultranet.com/~spiderb
PGP public key fingerprint: 96 72 D2 C6 E0 92 32 89 F6 B2 C2 A0 1C AB 1F DC