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!mx05.eternal-september.org!feeder.eternal-september.org!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada 2012: In-out parameters for functions Date: Mon, 6 May 2013 19:30:47 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7704abab-86f2-4edc-ad4b-b3d4e70004fb@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1367886652 13677 69.95.181.76 (7 May 2013 00:30:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 7 May 2013 00:30:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:15385 Date: 2013-05-06T19:30:47-05:00 List-Id: "Niklas Holsti" wrote in message news:aunb0nFir95U1@mid.individual.net... ... > However, the use of parameter mode notations in Ada calls is not likely > to become a nuisance. If the profile of the subprogram being called is > changed so that some parameter modes change, it seems to me highly > likely that all call sites must at least be inspected to see if they > still have the intended effects, and most call sites must probably be > modified to take the new parameter modes into account. Without parameter > modes in calls, the compiler can point out only some kinds of mode > conflicts, such as an uninitialized variable as the actual parameter for > an "in" or "in out", or a constant object as the actual parameter for an > "out" or "in out". If the calls specify parameter modes, the compiler > can point out all mode conflicts. Right. But the flip side to this is that it would be impossible to compatibly change a subprogram specification. Today, we can change "in out" to "in" and "in out" to "out" without breaking any calls -- and I've had to do both. Having the modes everywhere would definitely make the code more fragile. OTOH, there clearly are cases where having the mode explicitly mentioned would help readability (i.e. "in out" in functions). I don't think it is clear-cut either way. But I would like to see some nice syntax, none of which seems possible for Ada. Randy.