comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Conditional declarations (was: About String)
Date: Sun, 8 Jun 2008 15:17:03 +0200
Date: 2008-06-08T15:17:04+02:00	[thread overview]
Message-ID: <187kikv6obwut$.bn6fd5w57494$.dlg@40tude.net> (raw)
In-Reply-To: 4379495d-186e-418b-91b8-92b4da991807@e53g2000hsa.googlegroups.com

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

> On 8 Jun, 08:35, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> 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



  reply	other threads:[~2008-06-08 13:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 17:29 About String Sébastien Morand
2008-06-07 16:18 ` Simon Wright
2008-06-07 17:01   ` Pascal Obry
2008-06-07 22:13     ` Chris Moore
2008-06-08  6:47       ` Niklas Holsti
2008-06-08  7:35         ` Dmitry A. Kazakov
2008-06-08 10:29           ` Sebastien Morand
2008-06-08 10:53             ` Dmitry A. Kazakov
2008-06-08 11:14           ` Niklas Holsti
2008-06-08 13:16             ` Dmitry A. Kazakov
2008-06-08 17:17               ` Niklas Holsti
2008-06-09  7:26                 ` Dmitry A. Kazakov
2008-06-08 11:48           ` Martin
2008-06-08 13:17             ` Dmitry A. Kazakov [this message]
2008-06-08 18:26           ` Chris Moore
2008-06-08 18:32         ` Robert A Duff
2008-06-08 20:51           ` Maciej Sobczak
2008-06-08 21:19             ` Robert A Duff
2008-06-09  7:14               ` Dmitry A. Kazakov
2008-06-09  9:43                 ` Georg Bauhaus
2008-06-09 10:25                   ` Dmitry A. Kazakov
2008-06-09 10:42                     ` Sébastien Morand
2008-06-09 11:43                     ` Georg Bauhaus
2008-06-09 12:03                       ` Dmitry A. Kazakov
2008-06-15 19:38                 ` Robert A Duff
2008-06-15 20:52                   ` Dmitry A. Kazakov
2008-06-15 22:06                     ` Robert A Duff
2008-06-16  8:31                       ` Dmitry A. Kazakov
2008-06-16 19:17                         ` Robert A Duff
2008-06-16 20:30                           ` Dmitry A. Kazakov
2008-06-16 22:02                           ` Georg Bauhaus
2008-06-16 23:04                             ` Robert A Duff
2008-06-09 11:00               ` Georg Bauhaus
2008-06-09 14:27                 ` Britt Snodgrass
2008-06-15 19:50                   ` Robert A Duff
2008-06-15 19:48                 ` Robert A Duff
2008-06-08 11:13     ` Simon Wright
2008-06-08 19:03       ` Sebastien Morand
replies disabled

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