comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Exception types?
Date: 1998/06/08
Date: 1998-06-08T00:00:00+00:00	[thread overview]
Message-ID: <m3hg1vd4lw.fsf@mheaney.ni.net> (raw)
In-Reply-To: Pine.BSF.3.96.980608083034.15065A-100000@shell5.ba.best.com


Brian Rogoff <bpr@shell5.ba.best.com> writes:

> One of the things that always bothered me about exceptions in Ada 
> is that they are not really integrated into the type system, for example, 
> they are not part of a generic signature package. I looked through the 
> Ada 95 and Ada 83 Rationales to try to find a discussion of this topic, 
> but I couldn't find one. Is there some record available? 

Mats Weber pointed this out too, in his PhD thesis.

You can work around this feature by importing a package that contains an
exception declaration.  This is how Text_IO works, by importing package
IO_Exceptions.

Sort of like:

package Compiler_Exceptions is

   Syntax_Error : exception;

end;

generic
   procedure Scan (...);  
   --
   -- Raises Compiler_Exceptions.Syntax_Error.
...
package GP is ...;

An then the actual subprogram can import the Compiler_Exceptions package
too.

Actually, in Ada 95 this can be integrated with the package hierarchy.
This is how Ada.Strings... works.  All the exceptions are declared in
the root package.







  reply	other threads:[~1998-06-08  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-08  0:00 Exception types? Brian Rogoff
1998-06-08  0:00 ` Matthew Heaney [this message]
1998-06-09  0:00   ` Brian Rogoff
1998-06-15  0:00     ` Mats Weber
1998-06-15  0:00       ` Brian Rogoff
1998-06-21  0:00         ` Robert Dewar
1998-06-21  0:00         ` Robert Dewar
1998-06-15  0:00       ` Corey Ashford
     [not found]     ` <3586FFC0.5FEC1CBC@fiu.edu>
1998-06-17  0:00       ` Jean-Pierre Rosen
1998-06-18  0:00         ` Matthew Heaney
1998-06-19  0:00           ` Jean-Pierre Rosen
1998-06-10  0:00 ` Michel Gauthier
1998-06-11  0:00   ` Brian Rogoff
replies disabled

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