From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e4280c6ade7eb23 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Exception types? Date: 1998/06/08 Message-ID: #1/1 X-Deja-AN: 360895065 References: Organization: Network Intensive Newsgroups: comp.lang.ada Date: 1998-06-08T00:00:00+00:00 List-Id: Brian Rogoff 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.