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,999932ecc319322a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!news-FFM2.ecrc.net!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: advice on package design Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1110212638.336123.298580@l41g2000cwc.googlegroups.com> <1gbk0qx2sgzpg$.sltzfssofla8$.dlg@40tude.net> <3jok3ghqqls8$.1rrsonb8jsurt$.dlg@40tude.net> <88zllqj1min5$.fqqxis9i327d$.dlg@40tude.net> <18e9a92kz25wu$.8b965bel5vef$.dlg@40tude.net> <1dgodaruwhhwo$.1baazg490isjx.dlg@40tude.net> Date: Thu, 17 Mar 2005 21:48:40 +0100 Message-ID: NNTP-Posting-Date: 17 Mar 2005 21:48:34 MET NNTP-Posting-Host: 2bb612c2.newsread2.arcor-online.net X-Trace: DXC=eSeFcfP53__dJbi On 17 Mar 2005 14:10:11 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> On 17 Mar 2005 09:04:26 -0500, Robert A Duff wrote: >> >>> "Dmitry A. Kazakov" writes: >> >>>> I agree with the idea, but I think that hiding should appear in a >>>> declarative part. Less probably it should also qualify the thing being >>>> hidden (like renames does): >>> >>> I don't believe in declarative parts. I think declare/begin/end >>> should not be required just because I want to declare a constant >>> or something. >> >> Disagree. I don't like the idea of something changing its meaning within >> the same scope, even if that is non-existing -> exiting. I have to tolerate >> this in a declarative region because probably there is no better way to do >> it. But I don't want to let it leak out of the quarantine zone. > > I don't understand what you mean about "changing meaning". > I just want to be able to write things like: > > for I in A'Range loop Until here --> This_Component = nothing > This_Component: constant T := A(I); Below --> This_Component = constant T > ... several uses of This_Component > end loop; > > without adding three extra (useless) lines of code. > And we agreed that if there's another thing called This_Component, > this This_Component should not hide that This_Component. Maybe it is a matter of taste, but it is one of things in C++ which I hate the most. It is very difficult (to me) to understand a program with mixed declarations and statements. If you care about extra lines, then I'd propose: for I in A'Range -- All declarations be between for...loop This_Component: constant T := A(I); loop ... several uses of This_Component end loop; > The "hide" command I proposed is of dubious value, but if it were > allowed, I wouldn't mind restricting it to whole procedures > or something. Or not. But either way, I don't like the separation > of "declarations" and "statements". I like the separation very much. But let's consider getting rid of declarations. Wouldn't it be fake anyway? You know that better than me, but I suppose the compiler will need to move everything to the beginning of the closest scope. Otherwise: if Halt(x) then declare A; end if; Foo (A); -- Would it be legal? T := (1, 2, 4, declare X := 9, others => declare Y := 10); -- What would be this? How many Y's could be here? So I see no advantage in this. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de