> 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.
Exactly. This is not, by any means, all my idea. :-) I just formalized
it so we could get it in Perl 6, because I think it would be a big win.
> ->STRINGIFY. It's a verb, even though it's a neologism, and it's
> handier to type than the equivalent ->MAKE_STRING would be.
I'm not against other names. You're right, STRINGIFY has a ring to it,
but I worry it might be too catchy for its own good? Not sure.
The reason I thought SCALAR was good was because of this:
print scalar $object;
If this calls $object->SCALAR (I think it would) then I think that's a
compelling argument on its own.
-Nate