Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ucla-cs!zen!ucbvax!NEMS.ARPA!vitro From: vitro@NEMS.ARPA (Ronald Wonisch) Newsgroups: comp.lang.ada Subject: Exceptions as Generic Formal Parameters Message-ID: <8707021518.AA18876@nems.ARPA> Date: Thu, 2-Jul-87 11:18:00 EDT Article-I.D.: nems.8707021518.AA18876 Posted: Thu Jul 2 11:18:00 1987 Date-Received: Sat, 4-Jul-87 14:17:04 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 27 As a solution to your desire to trap an exception within a generic unit, it is suggested that you put your procedure within a package such as: package print is Printing_Error : Exception; generic type T is private; with procedure Try_to_Print_T (A_T : T); procedure Print_with_Caption (A_T : T; caption : string); end print; Here, Printing_Error is exported as the exception that Try_to_Print_T should raise for any printing error. I do not think there are any cases where this method (or slight variations there of ) would not only work, and also be more readable than if exceptions were passed as generic parameters. D.E. White vitro@nems.arpa -------