Talk About Network

Google





Programming > Ada > Conditional dec...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 18 of 38 Topic 5743 of 6006
Post > Topic >>

Conditional declarations (was: About String)

by "Dmitry A. Kazakov" <mailbox@[EMAIL PROTECTED] > Jun 8, 2008 at 03:17 PM

On Sun, 8 Jun 2008 04:48:56 -0700 (PDT), Martin wrote:

> On 8 Jun, 08:35, "Dmitry A. Kazakov" <mail...@[EMAIL PROTECTED]
>
> wrote:

>> package A is
>>     <some declarations>
>> exception
>>     <handling elaboration problems of A, HOW?>  (:-))
>> end A;
> 
> Admittedly the range of options is pretty limited if exception
> handlers where to be added to package specs but you could log an
> indication in a package local variable, set a default or re-raise the
> exception.

Aha, so many people are looking for Ada preprocessor! (:-)) What about
catching compile error in with-ing OS.Linux in order to with OS.Windows
instead? (:-))

> I rather like the idea...that forced nesting just to catch an
> exception is quite ugly and dare I day, goes against Ada's "easy to
> read and therefore maintain" mantra...

I think it could be solved in a different way, together with a closely
related  problem:

   if X in T'Class then
      declare
         TX : T'Class renames T'Class (X);
      begin
         ...
      end;
   end if;

   if Ptr /= null then
      declare
         Ptr_All : T renames Ptr.all;
      begin
         ...
      end;
   end if;

This is a pretty frequent and quite ugly construct, especially because it
verifies the same condition twice.

I think that a fail-safe declaration is in essence a similar thing. It
need
not to appear in the main declaration block, because it a combination of a
flow control and visibility scope.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
 




 38 Posts in Topic:
About String
=?ISO-8859-1?Q?S=E9bastie  2008-06-06 17:29:43 
Re: About String
Simon Wright <simon.j.  2008-06-07 17:18:12 
Re: About String
Pascal Obry <pascal@[E  2008-06-07 19:01:07 
Re: About String
Chris Moore <zmower@[E  2008-06-07 23:13:16 
Re: About String
Niklas Holsti <niklas.  2008-06-08 09:47:30 
Re: About String
"Dmitry A. Kazakov&q  2008-06-08 09:35:31 
Re: About String
Sebastien Morand <seb.  2008-06-08 10:29:53 
Re: About String
"Dmitry A. Kazakov&q  2008-06-08 12:53:16 
Re: About String
Niklas Holsti <niklas.  2008-06-08 14:14:04 
Re: About String
"Dmitry A. Kazakov&q  2008-06-08 15:16:54 
Re: About String
Niklas Holsti <niklas.  2008-06-08 20:17:33 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 09:26:26 
Re: About String
Chris Moore <zmower@[E  2008-06-08 19:26:21 
Re: About String
Robert A Duff <bobduff  2008-06-08 14:32:36 
Re: About String
Simon Wright <simon.j.  2008-06-08 12:13:50 
Re: About String
Sebastien Morand <seb.  2008-06-08 19:03:17 
Re: About String
Martin <martin.dowie@[  2008-06-08 04:48:56 
Conditional declarations (was: About String)
"Dmitry A. Kazakov&q  2008-06-08 15:17:03 
Re: About String
Maciej Sobczak <see.my  2008-06-08 13:51:07 
Re: About String
Robert A Duff <bobduff  2008-06-08 17:19:11 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 09:14:30 
Re: About String
Georg Bauhaus <rm.dash  2008-06-09 11:43:36 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 12:25:02 
Re: About String
=?ISO-8859-1?Q?S=E9bastie  2008-06-09 10:42:18 
Re: About String
Georg Bauhaus <rm.dash  2008-06-09 13:43:21 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 14:03:37 
Re: About String
Robert A Duff <bobduff  2008-06-15 15:38:08 
Re: About String
"Dmitry A. Kazakov&q  2008-06-15 22:52:45 
Re: About String
Robert A Duff <bobduff  2008-06-15 18:06:00 
Re: About String
"Dmitry A. Kazakov&q  2008-06-16 10:31:03 
Re: About String
Robert A Duff <bobduff  2008-06-16 15:17:15 
Re: About String
"Dmitry A. Kazakov&q  2008-06-16 22:30:12 
Re: About String
Georg Bauhaus <rm.tsoh  2008-06-17 00:02:51 
Re: About String
Robert A Duff <bobduff  2008-06-16 19:04:54 
Re: About String
Georg Bauhaus <rm.dash  2008-06-09 13:00:44 
Re: About String
Robert A Duff <bobduff  2008-06-15 15:48:49 
Re: About String
Britt Snodgrass <britt  2008-06-09 07:27:05 
Re: About String
Robert A Duff <bobduff  2008-06-15 15:50:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 12:59:56 PST 2009.