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

Re: A common base exception object for Perl - RFC



On Thu, Jan 20, 2000 at 02:23:04PM +0000, Pete Jordan wrote:
> Graham Barr wrote:
> 
> > Have you looked at the Error module on CPAN ?
> > 
> > At the conference last year there was a discussion about getting
> > better handling into the core itself. The Error module was given
> > as a starting point.
> 
> Yes but...
> 
> My personal feeling is that exception objects and syntactic sugar around
> C<eval {}> don't necessarily belong in the same module: I use both here,
> but I'm happy because it's /my/ syntactic sugar :)

I feel that there needs to be some defined "syntactic sugar" otherwise having
a defined class is of no great benefit as people will use it differently.

> - this sort of thing
> tends to be intensely personal and tied to each individual's experience
> of exception handling in other languages.

Yes you are right, Error as it stands also needs to be the base class.
But that can change. But what it does do is define some fields that are
required.
 
> My core purpose here is to standardise a base class for object
> references passed to C<die>; C<Error> could easily be recoded to use
> that base class and religious arguments about C<try {}> etc. syntax can
> happen in parallel.

True, but don't throw error out just because you don't like the syntatic
sugar. It already defines a base class. It just needs to be separated out.

> Of course, if an C<eval {}> wrapper were to be considered as being a
> useful addition to the core, those arguments would need to crystalise.

Agreed.

Graham.


Follow-Ups from:
Pete Jordan <pjordan1@email.mot.com>
References to:
Pete Jordan <pjordan1@email.mot.com>
Graham Barr <gbarr@pobox.com>
Pete Jordan <pjordan1@email.mot.com>

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