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,FREEMAIL_FROM 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.180.76.76 with SMTP id i12mr2907011wiw.6.1367665782539; Sat, 04 May 2013 04:09:42 -0700 (PDT) Path: hg5ni66829wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!nrc-news.nrc.ca!News.Dal.Ca!news.litech.org!news.etla.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Ada 2012: In-out parameters for functions Date: Wed, 01 May 2013 21:58:36 +0200 Organization: Ada @ Home Message-ID: References: <7704abab-86f2-4edc-ad4b-b3d4e70004fb@googlegroups.com> <16vvwvhsw7qit.dwhm4k8m5ggs$.dlg@40tude.net> NNTP-Posting-Host: nS0pckIoQAtdrQ+ei+VCFQ.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.15 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2013-05-01T21:58:36+02:00 List-Id: Le Wed, 01 May 2013 21:37:43 +0200, Dmitry A. Kazakov = a =C3=A9crit: > On Wed, 01 May 2013 21:04:03 +0200, Yannick Duch=C3=AAne (Hibou57) wro= te: > >> In/out (both way) parameters may be another story, and may more sugge= st >> this is a procedure and not a function, > > function Read (Stream : in out Root_Stream_Type) return String; > :D This is more a procedure than a function (it either won't return the sam= e = the next time invoked with the same argument or either the argument can = = never be considered to be the same as it use to be any=E2=80=91more), an= d a = function construct is used only because it is preferable to return an = unconstrained type (as Shark8 mentionned) than an access to the same = object allocated on the heap and returned via an out mode access type = parameter of a procedure. That's a good example of how a construct may not always match the intend= ed = semantic; it may happens one use a function to implement a procedure, or= a = procedure to implement a function. I feel `function` and `procedure` in Ada means something at the = implementation level more than at the intention level, even if many time= s = both matches as gloves and hands. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity