info-sather
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exceptions


From: Norbert Nemec
Subject: Re: Exceptions
Date: Wed, 11 Oct 2000 07:49:22 +0200
User-agent: Mutt/1.0.1i

On Wed, Oct 11, 2000 at 04:15:30PM +1300, Keith Hopper wrote:
>      Now just think of the following in relation to what I wrote --
> 
> > What is lacking in Sather is a mechanism to specify which exceptions a 
> > method may raise. After all, that really is part of the interface. If 
> > we had such a thing, exceptions would just become a special kind of 
> > return value. In many cases, there are three alternatives:
> 
> What is lacking in almost any exception mechanism which I have come across
> is the notion of the 'origin' of the exception - in which feature of which
> class and for which object was it raised?
> 
>      The same applies to interrupts and signals.  At present the rather
> primitive mechanism provided answer only one of those and then only in
> respect of programmer raised exceptions - the object involved!
> 
>      Which is not satisfactory!  As I said before, watch this space!

Is that really a fundamental language problem? Doesn't it rather depend 
on the EXCEPTION class that still has to be constructed? Just let it 
take a self: $OB as arguent to create and store it. As for the feature 
it was raised for: Sather does not know any concept of handling 
methods, features or classes at runtime. Binding does not help, since this 
only allows calling but not identification. They only exist at compile-time 
not as any kind of objects at run-time. Best you can do is to pass 
around strings or some other kind of artificial ID. Just let the create 
routine for the EXCEPTION class take such a thing as argument as well.

Now have

abstract class $EXCEPTION is
    ob: $OB;
    src: SRCID;  -- May just be a string or something more complex.
    ...
end;

And you have all you can wish for without generally changing the 
concept of Sather. The raise statements will grow a little more 
complex, but that's not a fundamental problem.

Ciao,
Nobbi

-- 
-- ______________________________________________________
-- JESUS CHRIST IS LORD!
--          To Him, even that machine here has to obey...
--
-- _________________________________Norbert "Nobbi" Nemec
-- Hindenburgstr. 44  ...  D-91054 Erlangen  ...  Germany
-- eMail: <address@hidden>   Tel: +49-(0)-9131-204180



reply via email to

[Prev in Thread] Current Thread [Next in Thread]