comp.lang.ada
 help / color / mirror / Atom feed
From: gauthier@unilim.fr (Michel Gauthier)
Subject: Re: Renaming exceptions in private section?
Date: 1996/04/22
Date: 1996-04-22T00:00:00+00:00	[thread overview]
Message-ID: <gauthier-2204961059290001@164.81.60.62> (raw)
In-Reply-To: 4l52fh$ivr@goanna.cs.rmit.edu.au

In article <4l52fh$ivr@goanna.cs.rmit.edu.au>, Dale Stanbrough
<dale@goanna.cs.rmit.EDU.AU> wrote:

>>  [...]
>>  When I tried...
>>  
>>          package fred is
>>          
>>                  a: exception;
>>                  
>>          private
>>                  b: exception;
>>                  a: exception renames b;
>>          end;
>>          
>>  ....Gnat complained that
>>  
>>          "a" conflicts with declaration at line 3
>>          
>>  Is it possible to rename an exception in the private section
>>  - sort of a deferred exception (similar to deferred constants)?

Strictly speaking, no, but a good trick could be to use
Exception_Id~entities (see for instance my old paper 
in Ada Letters).

with Ada . Exceptions ;  
package fred is
       a: constant Ada . Exceptions . Exception_Id ;
       ...
private
        b: exception;
        a: constant Ada . Exceptions . Exception_Id := B ' Identity ;
end;

----------          ----------          ----------          ---------- 
Michel Gauthier / Laboratoire d'informatique
123 avenue Albert Thomas / F-87060 Limoges
telephone +33 () 55457335 [or ~ 7232]
fax +33 ()  55457315  [or ~7201]
----------          ----------          ----------          ----------
La grande equation de la fin du siecle : windows-X = Mac-Y
The main end-of-century equation : windows-X = Mac-Y
----------          ----------          ----------          ----------
Si l'an 2000 est pour vous un mysticisme stupide, utilisez la base 9
If you feel year 2000 a stupid mystic craze, use numeration base 9
----------          ----------          ----------          ----------




      reply	other threads:[~1996-04-22  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-18  0:00 Renaming exceptions in private section? Dale Stanbrough
1996-04-22  0:00 ` Michel Gauthier [this message]
replies disabled

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