comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Ada2012 : Expression functions and extended return statements
Date: Fri, 06 Jan 2012 16:11:48 +0100
Date: 2012-01-06T16:11:48+01:00	[thread overview]
Message-ID: <je72vj$i3o$1@dont-email.me> (raw)
In-Reply-To: <Pine.LNX.4.64.1201061026400.18034@medsec1.medien.uni-weimar.de>

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



  parent reply	other threads:[~2012-01-06 15:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06  8:45 Ada2012 : Expression functions and extended return statements Martin
2012-01-06  9:45 ` stefan-lucks
2012-01-06 10:02   ` Martin
2012-01-06 11:23     ` Peter C. Chapin
2012-01-06 11:37       ` Martin
2012-01-06 13:13         ` Dmitry A. Kazakov
2012-01-06 14:45           ` Martin Dowie
2012-01-06 15:07             ` Martin
2012-01-06 16:40             ` Robert A Duff
2012-01-06 17:04               ` Martin Dowie
2012-01-19  7:47               ` David Thompson
2012-01-06 17:20             ` Dmitry A. Kazakov
2012-01-07  1:47               ` Randy Brukardt
2012-01-07  9:21                 ` Dmitry A. Kazakov
2012-01-06 16:45           ` Adam Beneschan
2012-01-06 16:36     ` Adam Beneschan
2012-01-07 14:54     ` stefan-lucks
2012-01-07 15:11       ` Dmitry A. Kazakov
2012-01-08  9:41         ` stefan-lucks
2012-01-09  6:16         ` Randy Brukardt
2012-01-06 15:11   ` J-P. Rosen [this message]
2012-01-06 15:26     ` Martin
2012-01-07  1:50       ` Randy Brukardt
2012-01-07 10:12         ` Martin
2012-01-07 12:22           ` Simon Wright
2012-01-07 17:10             ` Martin
2012-01-09  6:21           ` Randy Brukardt
2012-01-09  7:57             ` Martin Dowie
2012-01-31 23:34             ` Yannick Duchêne (Hibou57)
2012-01-06 16:33 ` Adam Beneschan
2012-01-06 16:38   ` Adam Beneschan
2012-01-06 22:12     ` Robert A Duff
2012-01-31 23:20 ` Yannick Duchêne (Hibou57)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox