[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: A common base exception object for Perl - RFC



"Redford, John" wrote:

> With a minimal base class you gain two things. First, all exception
> objects can be subclasses of Exception, permitting:
>         $@->isa('Exception')
> as a common handler for any exception. Secondly, the author of an
> Exception subclass does not have to ever know about the '""' code.
> While simple looking, it would be a large distraction for people to
> have to read `perldoc overload` (or think they have to read it).

Agreed. The only question is how minimal is minimal? What, if any,
facilities are 99.9% certain to be useful to /all/ exception classes?

In any case, as long as the base class defines the C<to_string> method
and does the C<use overload>, subclasses just need to provide their own
C<to_string> method, yes?

Pete
-- 
use Disclaimer::Standard;	# Motorola GSM Software Factory
my $phone='+44 1793 564450';	# "'Not twisted,' Salzy once said of
my $fax='+44 1793 566918';	#  her own passion, 'it is helical.
my $mobile='+44 7973 725120';	#  That sounds better.'"


Follow-Ups from:
Tom Horsley <Tom.Horsley@mail.ccur.com>
References to:
"Redford, John" <John.Redford@fmr.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]