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.117.197 with SMTP id kg5mr1856969pbb.5.1325868017291; Fri, 06 Jan 2012 08:40:17 -0800 (PST) Path: lh20ni144731pbb.0!nntp.google.com!news1.google.com!news2.google.com!news.glorb.com!xmission!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada2012 : Expression functions and extended return statements Date: Fri, 06 Jan 2012 11:40:16 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <94808f24-938b-476e-8912-f98b52982d53@j10g2000vbe.googlegroups.com> <1650969959347553100.869853martin-re.mo.ve.thedowies.com@news.btinternet.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1325868016 16150 192.74.137.71 (6 Jan 2012 16:40:16 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 6 Jan 2012 16:40:16 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:vzpuY1J3t1PRxVahrszKRd0dT4g= Content-Type: text/plain; charset=us-ascii Date: 2012-01-06T11:40:16-05:00 List-Id: 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