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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3867e2f73fa21ec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.163.8 with SMTP id ye8mr6411812pab.23.1367749491525; Sun, 05 May 2013 03:24:51 -0700 (PDT) Path: ln4ni1432pbb.0!nntp.google.com!npeer03.iad.highwinds-media.com!feed-me.highwinds-media.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada 2012: In-out parameters for functions Date: Sun, 05 May 2013 13:24:50 +0300 Organization: Tidorum Ltd Message-ID: References: <7704abab-86f2-4edc-ad4b-b3d4e70004fb@googlegroups.com> Mime-Version: 1.0 X-Trace: individual.net Td6+8MImrwzpD0BuVj5wCAs7C3llOWajdSsipouKeF8ssHZjTA Cancel-Lock: sha1:20nLAFkMYHKaK6PjLPwf1+07hR0= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: X-Received-Bytes: 2320 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2013-05-05T13:24:50+03:00 List-Id: On 13-05-04 02:29 , Randy Brukardt wrote: > I agree that named notation should include the direction of the parameter, > but again its way too late to fix. The best syntax would have been > Proc (In_Param => A, Out_Param <= B, In_Out_Param <=> C); > but unfortunately "<=" is used for less-than-or-equals and trying to use it > in this context would be ambiguous. > > So the best practical syntax would be: > Proc (In_Param -> A, Out_Param <- B, In_Out_Param <-> C); How about reusing the mode keywords: Proc ( In_Param => in A, Out_Param => out B, In_Out_Param => in out C); The mode keywords would be optional, of course, thus this extension would be upwards compatible with current Ada. Note that this syntax can be used with positional association calls, too: Proc (in A, out B, in out C); An alternative, perhaps more English-like, would be to put the mode keywords in front of the formal parameter: Proc ( in In_Param => A, out Out_Param => B, in out In_Out_Param => C); but I like the first form better, because its form and format are more familiar, especially when the "=>" are vertically aligned. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .