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-11 14:06:38 PST Path: bga.com!news.sprintlink.net!cs.utexas.edu!news.tamu.edu!pip.shsu.edu!pip.shsu.edu!not-for-mail From: stdsee01@pip.shsu.edu (Road Pilot) Newsgroups: comp.lang.ada Subject: Re: Syntax question Date: 11 Mar 1995 15:44:14 -0600 Organization: Sam Houston State University Message-ID: <3jt5je$d0u@pip.shsu.edu> References: <3jrt1m$9rk@erinews.ericsson.se> NNTP-Posting-Host: pip.shsu.edu X-Newsreader: Tin 1.1 PL5 Date: 1995-03-11T15:44:14-06:00 List-Id: Geoffrey Hollingworth (etlghh@garbo.ericsson.se) wrote: : Hi : : 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. : Is there a fundamental flaw in this line of thinking ? : Does ada manage this problem via a different mechanism ? : : Any information, historical or otherwise, would be a great help : to me and greatly appreciated. : : thanks : : /geoff Well, the arrow symbol "=>" is not meant to imply direction. It is used in the case statement (ex: WHEN choice => statement) and in aggregate assingments as well (ex: initializing specific cells of an array without multiple index references). This is all in contrast to positional reference. In your a function/procedure call, the use of the arrow notation is completely optional. In some cases of multiple parameters, it makes it easier to keep them straight. I like to use them mainly because it avoids confusion. Like so: procedure insert( list : in out integer; item : in integer ) is insert( 2, 4 ); OR insert (list=>2, item=>4); either way will work. I don't know if this helps any or just confuses more, but I guess the main thing is that the arrow is more like a placeholder or referencing tool and is not meant to imply direction. Sloaner stdsee01@pip.shsu.edu