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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f28dd1d63a9466b2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-13 05:43:56 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!ix.netcom.com!netcomsv!uucp3.netcom.com!telesoft!kst From: kst@thomsoft.com (Keith Thompson) Subject: Re: Syntax question Message-ID: Originator: kst@pulsar Keywords: help syntax Sender: news@thomsoft.com (USENET News Admin @flash) Organization: Thomson Software Products, San Diego, CA, USA References: <3jrt1m$9rk@erinews.ericsson.se> Date: Mon, 13 Mar 1995 04:43:56 GMT Date: 1995-03-13T04:43:56+00:00 List-Id: In <3jrt1m$9rk@erinews.ericsson.se> etlghh@garbo.ericsson.se (Geoffrey Hollingworth) writes: > I am currently researching into real time languages and hope > you ada experts can explain something to me. I apologise for > my lack of knowledge in ada. > When binding formal parameters with actual parameters the '=>' > operator is used, irrespective of whether the formal parameter > is declared as IN, INOUT or OUT. Is there a reason for this ? > If I proposed an alternative syntax where "=>" indicated the FP > was an IN parameter, "<=" to indicate an OUT parameter and "<=>" > to indicate an INOUT. > Then the caller of the procedure/function would have explicitly > had to understand to direction of the parameters and at the same > time increased the readability of his/her code. Some versions of preliminary Ada (1979, possibly 1980) used ":=", "=:", and ":=:" for named associations for in, out, and in out parameters, respectively. This was changed to "=>" for all three modes. As others have mentioned, this applies only to named notation; in positional notation you just write the actual expressions or names separated by commas. As part of the Ada 9X revision process, I proposed a revision to allow the parameter mode to be (optionally) specified for actual parameters by using "in", "out", or "in out". The compiler would check that the mode is consistent with the declaration. For example, given the declaration procedure Foo(X: in Integer; Y: out Integer); , and given that A and B are Integer objects, any of the following calls would be legal, along with numerous other combinations: Foo(A, B); -- existing syntax Foo(X => A, Y => B); -- existing syntax Foo(in A, out B); -- new syntax Foo(in X => A, out Y => B); -- new syntax and the following would be illegal: Foo(in X => A, in out Y => B); -- inconsistent mode specified for Y => B This change would have been entirely upward compatible, straightforward to implement, and (IMHO) could have dramatically improved readability in many cases, but it didn't make it into the language. Maybe for Ada 200X? -- Keith Thompson (The_Other_Keith) kst@thomsoft.com (kst@alsys.com still works) TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718 That's Keith Thompson *with* a 'p', Thomson Software Products *without* a 'p'.