comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Exception_Occurence and language designers
Date: Mon, 4 Dec 2017 21:55:20 +0100
Date: 2017-12-04T21:55:20+01:00	[thread overview]
Message-ID: <p04cnn$5jk$1@gioia.aioe.org> (raw)
In-Reply-To: p04b4d$mr4$1@dont-email.me

On 2017-12-04 21:27, G. B. wrote:
> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
> 
>> In Ada 83 exception was not a first-class type.
> 
> Still isn’t.

But its "class-wide" type Exception_Occurrence is.

>> In terms of tagged types it is like this:
>   
> Exceptions may be understood to be part
> of control structure. Doing so lets you see
> them as neither objects nor subprograms.
> So, in exceptional situations, the program
> isn’t moving along *if*s and *loop*s and calls;
> rather, a different mechanism of jumping is
> triggered. You can handle the situation by
> referring to its name, the exception’s,
> in a handler.

That was Ada 83. Then it became clear that the exception should carry 
user-defined and other information. One could of course invent new 
syntax in order to query and handle that information (e.g. to save and 
restore exception). Ada 95 decided to use normal types and values 
instead. So Exception_Id, Exception_Occurrence, Raise_Exception, 
Save_Occurrence appeared.

> Other answers explain what to do if the
> name is not in scope and how to print
> interesting information about what named
> exception has caused the situation.

Exception_Id is like Ada.Tag, it never actually dies. That is the 
problem with making exception full types like in C++ (along with loosing 
nice Ada's flat exception catch syntax in favor of ugly C++'s 
walkthrough catcher).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-12-04 20:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 11:17 Exception_Occurence and language designers Mehdi Saada
2017-12-04 12:32 ` Simon Wright
2017-12-04 14:00   ` Mehdi Saada
2017-12-04 14:31     ` Dmitry A. Kazakov
2017-12-04 20:27       ` G. B.
2017-12-04 20:55         ` Dmitry A. Kazakov [this message]
2017-12-05  0:16           ` G. B.
2017-12-05  8:35             ` Dmitry A. Kazakov
2017-12-05 20:05               ` G. B.
2017-12-05 20:48                 ` Dmitry A. Kazakov
2017-12-04 17:43 ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox