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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!elbereth!rutgers!nike!ucbcad!ucbvax!SIERRA.STANFORD.EDU!Mendal From: Mendal@SIERRA.STANFORD.EDU (Geoff Mendal) Newsgroups: net.lang.ada Subject: Re: Quite Limited! Message-ID: <12243822862.9.MENDAL@Sierra.Stanford.EDU> Date: Fri, 3-Oct-86 07:27:44 EDT Article-I.D.: Sierra.12243822862.9.MENDAL Posted: Fri Oct 3 07:27:44 1986 Date-Received: Sat, 4-Oct-86 12:44:15 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: Concerning mode 'out' on limited formals not defined in the package spec where the limited type is defined... The reason for this restriction has to do with data integrity. Consider the following (semantically invalid) compilation unit: with Text_Io; procedure Destroy_File (File : out Text_Io.File_Type) is begin null; end Destroy_File; If pass by reference is used, no problem. But if pass by copy is used, watch out: the copy back rule will result in a junk value being assigned to the actual parameter. The restriction is meant to preserve data privacy, and thwart attempts to destroy "limited" values without the defining package knowing about it. Note that for mode 'out' parameter associations, copy-in is not required except for some esoteric cases (see references below). This is an important difference between mode 'out' and 'in out'. In any case, the fix to your program is simple: use mode 'in out' instead of 'out'. References: LRM: 6.2(6 .. 7); 7.4.4(4) Barnes, "Programming in Ada": pp. 125, 132, 340 gom -------