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!mx02.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Question about name resolution Date: Tue, 20 Jan 2015 17:47:20 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 21 Jan 2015 00:46:52 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7519078e121dffe718f7ef9b6511f660"; logging-data="18026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rfJCo9UMdKlF78zzJEtGMPhu+0UXjH/U=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: Cancel-Lock: sha1:6feo6/AC0+sXWQ0jEsOGzGNZyqE= Xref: news.eternal-september.org comp.lang.ada:24657 Date: 2015-01-20T17:47:20-07:00 List-Id: On 01/20/2015 12:32 PM, Michael B. wrote: > > I was surprised that this compiles without warnings if neither of the procedures > is called. Why is such overloading allowed in Ada? It seems to make no sense to > write a procedure that cannot be called directly. Duff has discussed the current state of Ada regarding this. In Ada 80, subprograms without parameters had to be called with an empty parameter list. This was universally reviled and so it was removed in Ada 83. I don't remember enough about this to say how it would have applied in your case. The illustration of the difference I remember was function F (I : Integer) return Integer; -- F1 type IA is array (Integer range <>) of Integer; function F return IA; -- F2 In Ada 83 and later, the call F (5) is ambiguous. It could either be F1 with an argument of 5 or F2 with the result indexed by 5 In Ada 80 this was unambiguous; the call could only be to F1. To call F2 one had to write F () (5) This is not very helpful but I always like an excuse to air the useless trivia in my head. -- Jeff Carter "Ada has made you lazy and careless. You can write programs in C that are just as safe by the simple application of super-human diligence." E. Robert Tisdale 72