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.205.124.10 with SMTP id gm10mr393801bkc.8.1325869475369; Fri, 06 Jan 2012 09:04:35 -0800 (PST) Path: cj8ni60490bkb.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 06 Jan 2012 11:04:33 -0600 User-Agent: NewsTap/3.5.1 (iPad) From: Martin Dowie Newsgroups: comp.lang.ada Mime-Version: 1.0 Message-ID: <969888375347561992.217330martin-re.mo.ve.thedowies.com@news.btinternet.com> Subject: Re: Ada2012 : Expression functions and extended return statements References: <1650969959347553100.869853martin-re.mo.ve.thedowies.com@news.btinternet.com> Date: Fri, 06 Jan 2012 11:04:33 -0600 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-KQEXlMZNg7SwQi1c7quGxn++ueHGllcSLNpJc8WUqmqlPJH6rStopLvdTctAV1MlKDjpAsLqSakfeTG!0lcqHvGDUpkUeIubF5m1RLBz+BhuyelrekFJVP0Kv5Mcx0ZfMcmADGG34t6A0qmnUlUmXyWPP+3r!k5M91jCT7VNOv5AkhsXXxrLfwnQPrUt9XVL0SAGxLuYWZgI= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2402 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-01-06T11:04:33-06:00 List-Id: Robert A Duff wrote: > Martin Dowie writes: > >> 2012 RM 3.1 6/3 says it is a declaration (but I should have written >> 'Result' not 'Return'). > > Right, and it declares an object. > >> 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. > > - Bob Hmmm, I think the function name is the best clue...and thats all you have with an expression function now. Also, I tend to only use a variable called 'Result' these days, which works for both ordinary and extended return statements but does say what the result represents - so thats kind of a special case, all other variables are named to give, at least, a clue as to what the value represents! -- Martin -- -- Sent from my iPad