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-02-26 01:24:32 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: Thu, 26 Feb 2004 10:34:17 +0100 Message-ID: <9ler30hebuuaeu6toli3ntsad3t8vjq64b@4ax.com> References: <4020C947.81A6D703@0.0> <1075907239.138068@master.nyc.kbcfp.com> <402232E9.3EE15B4B@0.0> <1075987360.225622@master.nyc.kbcfp.com> <40236C0B.E988E003@0.0> <1077634311.254581@master.nyc.kbcfp.com> <82347202.0402251405.2db2f3c5@posting.google.com> <1077747598.55635@master.nyc.kbcfp.com> 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 1077787471 53275399 I 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:5828 Date: 2004-02-26T10:34:17+01:00 List-Id: On Wed, 25 Feb 2004 17:19:50 -0500, Hyman Rosen wrote: >Jim Rogers wrote: >> But how does his order of evaluation work with named notation? > >I would go with the order of the actual parameters, >not the order of the formal parameters. One goal of >specifying evaluation order is to have unsurprising >behavior, so saying > Battery(Catcher => GetName, Pitcher => GetName); >should assign the first name read to Catcher and the >second to Pitcher, regardless of the order of the formal >parameters of Battery. > >I can't at the moment think of a good reason for doing it >the other way from the programmer's point of view, rather >than for the convenience of the compiler. Discriminants are exposed as members and can be used in named associations. From any point of view they are better to be evaluated first: type Buffer (Size : Integer) is record Data : String (1..Size); end record; Note that the aggregate: Buffer'(Data => ..., Size => ...) is quite legal. So by fixing the evaluation order here the compiler will be forced to make a temporal copy of the Data field, because it will be unable to create Buffer not knowing Size. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de