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!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Functions vs constants Date: Thu, 24 Jul 2014 12:01:43 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1406217670 26289 192.74.137.71 (24 Jul 2014 16:01:10 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 24 Jul 2014 16:01:10 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:GNiACptYmRn5fb718htFA0FGDbI= Xref: news.eternal-september.org comp.lang.ada:21185 Date: 2014-07-24T12:01:43-04:00 List-Id: Victor Porton writes: > It seems to me, that making constants functions (and so overloadable) would > not change meaning of any legal Ada program. I think you can construct cases that are currently legal that would become illegal with your proposed change. How about this: procedure Overloaded(X: Integer); procedure Overloaded(X: Boolean); procedure P is X: constant Integer := 1; procedure Q is X: constant Boolean := True; begin Overloaded(X); ... The above is legal, and calls the Boolean version of Overloaded. If the X's overloaded each other, it would be ambiguous, and therefore illegal. Now, you might say the above SHOULD be illegal, and I'd agree. But it's currently legal, and we shouldn't be breaking legal programs. > Thus, in my opinion, there is no reason to refuse this my proposal to make > constants functions (and so overloadable). Another reason is implementation difficulty. I suspect it might be an earthquake for some implementations, so it might not be worth the trouble -- not sufficiently broken. - Bob