comp.lang.ada
 help / color / mirror / Atom feed
* Current exception name
@ 1999-01-30  0:00 Pascal MALAISE
  1999-01-31  0:00 ` dewar
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal MALAISE @ 1999-01-30  0:00 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-01-31  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-30  0:00 Current exception name Pascal MALAISE
1999-01-31  0:00 ` dewar
1999-01-31  0:00   ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox