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

* Re: Current exception name
  1999-01-30  0:00 Current exception name Pascal MALAISE
@ 1999-01-31  0:00 ` dewar
  1999-01-31  0:00   ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: dewar @ 1999-01-31  0:00 UTC (permalink / raw)


In article <36B2BD5F.98C30EDF@magic.fr>,
  Pascal MALAISE <malaise@magic.fr> wrote:
> Has anyone found a standard Ada95 way to achieve that?

This obviously cannot be done using only standard features.
That is why GNAT provides the necessary intrinsic functions
to duplicate this feature (which was by the way I believe
first implemented in the DEC compiler).

Robert Dewar
Ada Core Technologies

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Current exception name
  1999-01-31  0:00 ` dewar
@ 1999-01-31  0:00   ` Simon Wright
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Wright @ 1999-01-31  0:00 UTC (permalink / raw)


dewar@gnat.com writes:

> In article <36B2BD5F.98C30EDF@magic.fr>,
>   Pascal MALAISE <malaise@magic.fr> wrote:
> > Has anyone found a standard Ada95 way to achieve that?
> 
> This obviously cannot be done using only standard features.
> That is why GNAT provides the necessary intrinsic functions
> to duplicate this feature (which was by the way I believe
> first implemented in the DEC compiler).

There was something very like this in Rational Delta 4 (and very
likely others, just that's the one I used)




^ 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