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-Thread: a07f3367d7,3867e2f73fa21ec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 X-Received: by 10.224.130.195 with SMTP id u3mr31172542qas.1.1367786231445; Sun, 05 May 2013 13:37:11 -0700 (PDT) Path: y6ni12161qax.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada 2012: In-out parameters for functions Date: Sun, 05 May 2013 23:37:10 +0300 Organization: Tidorum Ltd Message-ID: References: <7704abab-86f2-4edc-ad4b-b3d4e70004fb@googlegroups.com> Mime-Version: 1.0 X-Trace: individual.net c1s0XTN7e7M1GVUKaYCJxgNWXoOH5R5P0Lfo14lqO+H5/nGBDh Cancel-Lock: sha1:I/zUESQb4F3JVga+F0oGlF7GGMU= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2013-05-05T23:37:10+03:00 List-Id: On 13-05-05 22:23 , Yannick DuchĂȘne (Hibou57) wrote: > Le Sun, 05 May 2013 17:09:11 +0200, Niklas Holsti > a Ă©crit: >> I believe I have made some Ada coding errors that would have been >> revealed by mode notations in calls. I don't remember the exact >> examples, but I think one concerned a procedure in which an "in" >> parameter was changed to an "in out" parameter, because some new uses of >> the subprogram required it -- but then some old uses no longer worked, >> because they assumed that the actual for this parameter would not be >> changed. And the actual was a non-constant object, so the compiler saw >> nothing wrong in its use for an in-out parameter. > > That's an argument for Randy's idea to make constant the default mode > for local variable and constant declarations. Perhaps... as I remember, this object (the actual parameter in the example I remember) was an array, or a record, which was built up by several assignment statements, so it could not be a constant, without considerable changes to the code. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .