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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,239b92bbdaf8d8d3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-04 01:53:17 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Array of exception Date: Thu, 4 Oct 2001 08:53:10 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1002185590 29318 217.17.192.37 (4 Oct 2001 08:53:10 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Thu, 4 Oct 2001 08:53:10 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:13708 Date: 2001-10-04T08:53:10+00:00 List-Id: * tmoran@acm.org wrote: >> when -1 => raise EXXX; >> when -2 => raise EYYY; >> ... >>Using Exception_Id and Raise_Expression require me to rewrite the whole CASE >>into an explicit array so I do not shorten the source code anyway. > >Clarify please. It appears that somewhere you need to establish the >relation between, eg, -2 and EYYY. Trivial: I'd tried type extract_inband_exception_t is array(Positive) of exception; extract_inband_exception : constant extract_inband_exception_t := ( EXXX, EYYY, ... ); in order to instanciate the list of exceptions and there order at once. >Is > case res is > when -1 => raise EXXX; > when -2 => raise EYYY; > ... >preferable to > jump : constant array(...) of Exception_ID := > (-1 => EXXX'Identity, > -2 => EYYY'Identity, > ... Yep. The case generates faster code for the normal return value case. ;-)