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,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-26 02:09:47 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: In-Out Parameters for functions Date: Mon, 26 Jan 2004 11:17:22 +0100 Message-ID: References: NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1075111786 24304474 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:4801 Date: 2004-01-26T11:17:22+01:00 List-Id: On Mon, 26 Jan 2004 00:02:45 +0300 (MSK), "Alexandre E. Kopilovitch" wrote: >Therefore, IN OUT parameters in functions will not be worse than the ability >of functions to change global variables if we forbid use of such functions in >expressions, that is: > > If at least one parameter of a function is in IN OUT mode then the function > cannot be used in a compound expression. This function's call must always > constitute the whole RHS of an assignment. > >or less restrictive rule: > > If at least one parameter of a function is in IN OUT mode then in any > expression in which this function is called all other calls may be for > parameterless functions only. What about: F(X) and then F(X) The rule, if any, should prevent using an object in IN OUT mode in an expression where the evaluation order is not specfied by the language. Looks much like the aliasing problem: procedure Foo (X, Y : in out Object) is begin X := F(X) + F(Y); -- Is this legal? Foo (X, X); -- And this? end Foo; -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de