On Tue, Aug 08, 2000 at 07:01:29PM -0700, Nathan Wiger wrote:
> > On Tue, Aug 08, 2000 at 02:18:07PM -0000, Perl6 RFC Librarian wrote:
> > > Hooks will have to be put in Perl's string context so that if something
> > > is an object, then that object's C<STRING> method is called
> > > automatically. If no C<STRING> method is defined, then it should simply
> > > return undef (instead of printing out the ref/class info).
> > 
> > I'm not so sure about returning undef here.  Why not fall back to the
> > default behaviour of Perl 5 without overload q{""} magic?  As in, return the
> > stringified reference.
> 
> The problem here is akin to what Andy Dougherty mentioned to me in a
> private email: What if the $object doesn't contain appropriate string
> data, but perhaps image data?

I must be missing something.  What if $object contains image data?  How is
that relevant to returning a stringified reference if no STRING method is
provided?

 
> Because of this, I think the correct approach is this line from the RFC:
> 
>     print "$object";
> 
>   should always return something that's worth seeing, even if
>   that's nothing.

I think a stringified reference is worth seeing, moreso than a simple undef,
for debugging purposes if nothing else.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to