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,f68343f1c39afa29,start X-Google-Attributes: gid103376,public From: Pascal MALAISE Subject: Current exception name Date: 1999/01/30 Message-ID: <36B2BD5F.98C30EDF@magic.fr>#1/1 X-Deja-AN: 438734383 Content-Transfer-Encoding: 7bit X-Client: Magic On Line [unknown@ppp11-190.magic.fr] X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ulysse.magic.fr X-Trace: ulysse.magic.fr 917683551 379 127.0.0.1 (30 Jan 1999 08:05:51 GMT) Organization: Magic On Line Mime-Version: 1.0 NNTP-Posting-Date: 30 Jan 1999 08:05:51 GMT Newsgroups: comp.lang.ada Date: 1999-01-30T08:05:51+00:00 List-Id: In Ada 83, I use the Verdix package CURRENT_EXCEPTION which has the function EXCEPTION_NAME return STRING; In my programs: with CURRENT_EXCEPTION; ... exception when others => TEXT_IO.PUT_LINE ("Exception " & CURRENT_EXCEPTION.EXCEPTION_NAME); ... end; Now "porting" to gnat in Ada95, I'm trying to get a similar feature by writting my own Current_Exception package. If I have properly understood, the standard use of Ada.Exceptions obliges me to changes my handlers by: exception when Current_Exception.Id: others => Text_Io.Put_Line ("Exception " & Current_Exception.Exception_Name(Id)); ... end; I would like my code to be still compatible with Ada83 (except the Current_Exception package). I have found what I thing gnat-specific use of System.Compiler_Exceptions: with Ada.Exceptions; with System.Compiler_Exceptions; package body Current_Exception is function Exception_Name return String is begin return Ada.Exceptions.Exception_Name( System.Compiler_Exceptions.Current_Exception); end Exception_Name; end Current_Exception; Has anyone found a standard Ada95 way to achieve that? -- Pascal MALAISE (priv) mailto:malaise@magic.fr (prof) mailto:malaise@fr.airsysatm.thomson-csf.com