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 Received: by 10.68.74.201 with SMTP id w9mr4491827pbv.0.1325862796950; Fri, 06 Jan 2012 07:13:16 -0800 (PST) Path: lh20ni144048pbb.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Ada2012 : Expression functions and extended return statements Date: Fri, 06 Jan 2012 16:11:48 +0100 Organization: A noiseless patient Spider Message-ID: References: <26f343ea-d694-4089-b594-f32b471db3a4@m4g2000vbc.googlegroups.com> Mime-Version: 1.0 Injection-Date: Fri, 6 Jan 2012 15:11:47 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="aoPRI530w7EMd3PR4/B78Q"; logging-data="18552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+h+u4vIlx+QN0XJgfEr/MG" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Cancel-Lock: sha1:Djezb021WuTF68NAJ9xBXmDeueU= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2012-01-06T16:11:48+01:00 List-Id: Le 06/01/2012 10:45, stefan-lucks@see-the.signature a �crit : > On Fri, 6 Jan 2012, Martin wrote: > >> 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: > > I guess, this is because the object actually returned may not necessarily > be of exactly the same type of subtype as the declared return type -- like > the ordinary return statement. That's a good reason, but there is also a general principle that whenever an object is declared, it's type appears in the same declaration. This means that when you read the code, you know the type of the object, without needing to look elsewhere - for example, renaming could have used the type of the renamed object, but then the reader could be forced to follow a chain of renaming declarations to discover the type of the object. In Ada, we favour the reader over the writer, don't we? -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00