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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no 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 kg5mr1158913pbb.5.1325849091037; Fri, 06 Jan 2012 03:24:51 -0800 (PST) Path: lh20ni142358pbb.0!nntp.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 06 Jan 2012 05:23:27 -0600 Date: Fri, 06 Jan 2012 06:23:03 -0500 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada2012 : Expression functions and extended return statements References: <26f343ea-d694-4089-b594-f32b471db3a4@m4g2000vbc.googlegroups.com> In-Reply-To: Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-FCRPEuxDBNwQtptxSD/oRGVo1u635BkIBETNfBm+NdLNSyfP6TpdKoQKRchAKLteKHH0VibwH1Kr32N!Svf9cKmYZf22PnU90TCZDHUU88uPKZYuQKqsq3E+60MlhkqyeA4cwznB3o3tXX8= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html 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: 2301 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-01-06T06:23:03-05:00 List-Id: On 2012-01-06 05:02, Martin wrote: > I still think it would be nice to have a short-hand e.g. 'return > Result :<> do'. If anything it would then draw the eye to the more > interesting case when the 2 are different. You need to repeat the type for ordinary returns as well. function F return Integer is Result : Integer; -- Duplication of return type here. begin Result := 1; return Result; end F; To be consistent it seems like you'd need to be able to use '<>' throughout the body of the function. function F return Integer is Result : <>; -- Shorthand for function's return type. begin Result := 1; return Result; end F; Considering Ada's tendency to require one to repeat information in earlier declarations, this seems a bit unAda-like to me. Also this would allow '<>' to show up in a lot of strange looking places such as type conversions and type qualifications. Peter