On Tue, Aug 15, 2000 at 11:47:03AM -0500, Jonathan Scott Duff wrote:
> On Tue, Aug 15, 2000 at 11:47:32AM +0100, Graham Barr wrote:
> > On Mon, Aug 14, 2000 at 10:56:36AM -0500, Jonathan Scott Duff wrote:
> > > try { }
> > > catch SomeException { }
> > > catch SomeOtherException { }
> > > finally { }
> > >
> > > which seems to only catch exceptions based on name.
> >
> > Yes, but an exception has multiple names as it is a class name
> > and you perform ->isa(name)
>
> So are you saying that the above code is really executing something
> like this:
>
> try { }
> catch {
> switch ($@) {
> case ^_->isa('SomeException') { }
> case ^_->isa('SomeOtherException') { }
> }
> }
> finally { }
> ?
Yes. So you can have a hierarchy of exceptions. For example
IO
EOF
iBadHandle
Math
DivisionByZero
etc...
Also, I have come to dislike the name `exception', its too long for me :)
and who says we have to copy everyone else.
Lookin in the thesaurus we get
[Nouns] nonconformity [more]; unconformity, disconformity;
unconventionality, informality, abnormity,
abnormality, anomaly; anomalousness; exception, peculiarity; infraction
of law, breach, of law, violation of law, violation of custom, violation
of usage, infringement of law, infringement of custom, infringement
of usage; teratism, eccentricity, bizarrerie, oddity, je ne sais quoi,
monster, monstrosity, rarity; freak, freak of Nature, weirdo, mutant;
rouser, snorter [U.S.].
As perl is an exceptional language itself, why not have
`freaks' instead :)
Graham.