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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.mixmin.net!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: some trivial questions? Date: Wed, 08 Nov 2017 17:49:10 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <6a5368c5-f015-4dcb-9291-e77b40fa1bf1@googlegroups.com> NNTP-Posting-Host: shell02.theworld.com Mime-Version: 1.0 Content-Type: text/plain X-Trace: pcls7.std.com 1510181350 10111 192.74.137.72 (8 Nov 2017 22:49:10 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 8 Nov 2017 22:49:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:a9Cm82Y4noz7jIpOQ2T4vwOQUVg= Xref: feeder.eternal-september.org comp.lang.ada:48776 Date: 2017-11-08T17:49:10-05:00 List-Id: "Dmitry A. Kazakov" writes: > And we still need distinction between them in protected objects. But > that is the issue of conflation of dedicated output with no-effects. Making protected functions special in that way was a mistake, I think. >> I'd also prefer that function results and 'out' parameters >> have identical semantics, which they don't in Ada. > > Yes, but there are syntax problems with that: > > procedure Generate_Two_Strings (X, Y : out String); > > How do I declare > > X, Y : constant String := Generate_Two_Strings; Something like: X, Y : constant String; Generate_Two_Strings (X, Y); could be made to work. But that's nothing like Ada. > How do I do > > 2 x Ada.Text_IO.Put_Line (Generate_Two_Strings); Store them in constants, I guess. >> But you don't want use_clauses that are >> nested deep inside some block_statement to imply a "with". > > Why not? Because the with's show the overall structure of the program, so should be near the top of each package. (I'd prefer inside the package, rather than before it.) > BTW, there is no reason why "with" should not be nested. If a unit can > depend or not on a unit so a block can. One could even invent some > interesting elaboration rules for nested "with"s. (:-)) And in effect > nested "with" do exist for separate bodies. The rules about subunits are just plain weird. They confuse the issues of visibility/dependence and separate compilation. >> I think nested packages and child packages should have identical >> semantics (so "with" should apply to both). That was probably >> impossible, because child packages were invented too late. > > Yes. E.g. what if nested package instantiation would not imply "with"? > Should the similar [flawed] logic apply here as to "use"? I don't understand those questions. - Bob