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: 103376,cced0e2ac94722f3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.196.130 with SMTP id im2mr1507527pbc.3.1326959222114; Wed, 18 Jan 2012 23:47:02 -0800 (PST) Path: lh20ni198992pbb.0!nntp.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe14.iad.POSTED!1d9d5bd3!not-for-mail From: David Thompson Newsgroups: comp.lang.ada Subject: Re: Ada2012 : Expression functions and extended return statements Message-ID: <8kifh7te47o9d8dk9sp0g71k8rp1auerok@4ax.com> References: <94808f24-938b-476e-8912-f98b52982d53@j10g2000vbe.googlegroups.com> <1650969959347553100.869853martin-re.mo.ve.thedowies.com@news.btinternet.com> X-Newsreader: Forte Agent 3.3/32.846 MIME-Version: 1.0 X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Thu, 19 Jan 2012 07:47:01 UTC Organization: TeraNews.com Date: Thu, 19 Jan 2012 02:47:41 -0500 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: 2012-01-19T02:47:41-05:00 List-Id: On Fri, 06 Jan 2012 11:40:16 -0500, Robert A Duff wrote: > Martin Dowie writes: > > A bit like Pascal(?), didn't use the function's name at the point of > > return?...so for function 'Foo' you wrote something like, > > > > Foo := 100; > > > > ? > > Yes, that's the Pascal method. The problem with it is that > if you say something like "Foo := Foo + 1;" it does something > very wrong, especially if Foo has no parameters. > > But the general principle that the result should have a > name is a good one. > Classic FORTRAN used the FUNCTION name as the result variable, even on RHS because it didn't support recursion. F90 added options to specify a different name for the result variable, and for recursive.