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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec3c155a33990ec6,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: "zork" Newsgroups: comp.lang.ada Subject: "out" and "in out" Date: Mon, 26 Jul 2004 19:58:22 +1000 Organization: - X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 220.244.246.44 X-Original-NNTP-Posting-Host: 220.244.246.44 Message-ID: <4104d5de@dnews.tpgi.com.au> X-Trace: dnews.tpgi.com.au!tpg.com.au 1090835934 220.244.246.44 (26 Jul 2004 19:58:54 +1000) Path: g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed.freenet.de!nntp.gblx.net!nntp3.phx1!dnews.tpgi.com.au!tpg.com.au!not-for-mail Xref: g2news1.google.com comp.lang.ada:2392 Date: 2004-07-26T19:58:22+10:00 List-Id: Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By chance I created a small program as follows: =========== s : string := "CAT"; procedure modify ( s1 : out string ) is begin s1(2) := 'U'; end modify; .. put ( modify(s) ); =========== now I get as a result "CUT", and i dont understand why i get this result. Doesnt the "out" specify that its initial value isnt passed in via the parameter? But it seems to be passed in the above. In fact the "out" is acting like an "in out". I am a little confused. Could someone shed some light on this? Many thanks! zork