From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86c750b8474bf6d5 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer!btnet!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Conditional declarations (was: About String) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <484ABED3.8040909@obry.net> <484b802a$0$23844$4f793bc4@news.tdc.fi> <4379495d-186e-418b-91b8-92b4da991807@e53g2000hsa.googlegroups.com> Date: Sun, 8 Jun 2008 15:17:03 +0200 Message-ID: <187kikv6obwut$.bn6fd5w57494$.dlg@40tude.net> NNTP-Posting-Date: 08 Jun 2008 15:17:04 CEST NNTP-Posting-Host: 90877d27.newsspool3.arcor-online.net X-Trace: DXC=EMgZQdLYRP=_A0jCfgHO6>McF=Q^Z^V384Fo<]lROoR18kF[6LHn;2LCV>[ On Sun, 8 Jun 2008 04:48:56 -0700 (PDT), Martin wrote: > On 8 Jun, 08:35, "Dmitry A. Kazakov" > wrote: >> package A is >> � � >> exception >> � � �(:-)) >> 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