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,start 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 im2mr3648349pbc.3.1325840024243; Fri, 06 Jan 2012 00:53:44 -0800 (PST) Path: lh20ni141181pbb.0!nntp.google.com!news1.google.com!postnews.google.com!m4g2000vbc.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Ada2012 : Expression functions and extended return statements Date: Fri, 6 Jan 2012 00:45:26 -0800 (PST) Organization: http://groups.google.com Message-ID: <26f343ea-d694-4089-b594-f32b471db3a4@m4g2000vbc.googlegroups.com> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 X-Trace: posting.google.com 1325839935 7358 127.0.0.1 (6 Jan 2012 08:52:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 6 Jan 2012 08:52:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m4g2000vbc.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALERCFNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20100101 Firefox/9.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-01-06T00:45:26-08:00 List-Id: Am I correct in thinking these 2 parts of the language can't be 'mixed'?... There doesn't seem to be anything that allows anything like, e.g. package Foo is type T (<>) is tagged private; function Create return T is (Result : T do Result.I := 1); private type T is tagged record I : Integer; end record; end Foo; Also, on the topic of extended return statements... What's the rational for having to explicitly repeat the return type? Seems rather redundant to my eyes. I wouldn't have minded: function Bar return Some_Type is begin return Result : <> do -- something to initialise 'Result' end return; end Bar; or even function Bar return Some_Type is begin return Result do -- something to initialise 'Result' end return; end Bar; In this case, 'Result' can't be anything other than of type 'Some_Type' can it? -- Martin