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!news.eternal-september.org!feeder.eternal-september.org!maths.tcd.ie!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: Mon, 06 Nov 2017 17:37:31 -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 1510007851 17417 192.74.137.72 (6 Nov 2017 22:37:31 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 6 Nov 2017 22:37:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:jEi+QtHCq7uttNbX/wh2ZqbouDc= Xref: news.eternal-september.org comp.lang.ada:48748 Date: 2017-11-06T17:37:31-05:00 List-Id: tclwarrior@gmail.com writes: > Why in ada, there is a separation between functions and procedures? Probably because Pascal did it that way, and Ada is (very loosely!) based on Pascal. > Is there any real value in this? Not really. I'd prefer that both things be called "procedure". Then we wouldn't need the terms "function" and "subprogram". But we'd still need a distinction between procedures that return a value and those that don't. I'd also prefer that function results and 'out' parameters have identical semantics, which they don't in Ada. The difference should be purely syntactic. > Also why does is Use imply With? As mentioned elsewhere, you meant "why DOESN'T use imply with?". It should. A use_clause that occurs in a context clause, and that mentions a library package name, should imply a "with" on that package. But you don't want use_clauses that are nested deep inside some block_statement to imply a "with". And as others have mentioned, "use" should usually (but not always) be deeply nested. 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. And it's annoying that if you want to use a package, you have to with it, and "with" is not a verb in English. > For example why do i have to say: > > with Ada.Text_IO; > use Ada.Text_IO; > > Is there any case where the Use statement will be ambiguous, if i skip > the with part? No, there's no semantic problem with what you suggest. There's no readability problem either, because a use clause in a context clause is clearly in a context clause. Assuming, of course, that you didn't want OTHER use clauses (deeply nested) to imply a with (up at the top). - Bob