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 X-Google-Thread: 103376,1e4280c6ade7eb23 X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Exception types? Date: 1998/06/17 Message-ID: <6macfi$hm6$1@platane.wanadoo.fr>#1/1 X-Deja-AN: 363774003 Content-Transfer-Encoding: 8bit References: <3586FFC0.5FEC1CBC@fiu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Adalog Newsgroups: comp.lang.ada Date: 1998-06-17T00:00:00+00:00 List-Id: The big issue with passing exceptions to generics, exception types, etc. is that you don't want two handlers for the same exception. Imagine (not Ada); generic E1 : exception; E2 : exception; procedure P; procedure P is .. begin ... exception when E1 => ... when E2 => ... end; Then, an instanciation like: procedure Q is new P (Constraint_Error, Constraint_Error); would end up with two different handlers for the same exception ! Therefore it is clear that *catching* an exception can only be done with statically defined exception names. Therefore, the only remaining interesting thing that could be done with "exception variables" would be raising. But this is now available with the package Ada.Exceptions. Therefore, there is no need to add these features to the language. -- ---------------------------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://perso.wanadoo.fr/adalog Luis Espinal a �crit dans le message <3586FFC0.5FEC1CBC@fiu.edu>... >Yeah, that's a question I've asked myself when I learned Ada at FIU in >1995; there >must have been some reason to leave out (or avoid) typed exceptions, >passing >exceptions to packages. I just can't think of one, but again, I'm still >learning; >I really would like to know whether this omission of typed exceptions is >a >feature promoting better software engineering or an "accident". Does >anybody >would know of a possible answer? > >If you would like to satisfy my curiosity, then many thanks:) > >Luis Espinal.