comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@d2-hrz.uni-duisburg.de>
Subject: Re: Interesting effects in array renaming
Date: Tue, 24 Jun 2003 14:38:51 +0000 (UTC)
Date: 2003-06-24T14:38:51+00:00	[thread overview]
Message-ID: <bd9npr$mm8$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: bd8uq6$q0jfa$1@ID-77047.news.dfncis.de

Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
: Georg Bauhaus wrote:
: 
:> I don't think it is so bad, it is much more an issue of what
:> renaming means, maybe?
: 
: No, it is an issue of which meaning has an explicit specifying of a subtype. 

Hm. 

  procedure foo(a: Apple) is
     p: Orange renames a;

may be correct, but confusing. Because, in my view a least, the
programmer is violating the usual meaning of "renames".
I think the bias is towards the wrong side/word if "Orange"
outweighs "renames".


:> Most prominently, you give another name
:> to an entity, you don't make a new entity.
: 
: Really? To me a "view" is definitely an "entity". You probably mean that 
: renaming should not create a new object.

Yes.

: But it is no matter, imposing a 
: constraint on an existing object does not change the object. It is merely a 
: precondition.

Should renaming be for imposing constraints?
If I rename myself as Bouwhouws, that won't change me I think,
and it doesn't impose a constraint on me. That's renaming for me.
It won't even change the sound of my name ;-)

: for I in Constrained'Range loop
:   X2 (I) := 0;
: end loop;
: 
: may raise Constraint_Error or else corrupt memory if range checks are 
: suppressed. It is abolutely unacceptable. To put it in one sentence: either 
: you change bounds or you check them.

But if you declare a subtype with constraints to be used in a renaming
declaration, then you know the constraints. You also know the bounds of
objects involved, by way of attributes. So you could make your intention
more explicit by using these known quantities if you want to avoid
copying.


-- sb463ba



  reply	other threads:[~2003-06-24 14:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-22 14:52 Interesting effects in array renaming Dmitry A. Kazakov
2003-06-22 17:24 ` Jeffrey Carter
2003-06-23  8:12   ` Dmitry A. Kazakov
2003-06-23 10:29     ` Georg Bauhaus
2003-06-23 11:37       ` Dmitry A. Kazakov
2003-06-23 13:28         ` Georg Bauhaus
2003-06-24  7:35           ` Dmitry A. Kazakov
2003-06-24 14:38             ` Georg Bauhaus [this message]
2003-06-25 10:28               ` Dmitry A. Kazakov
2003-06-25 14:23                 ` Georg Bauhaus
2003-06-25 19:00                   ` Dmitry A. Kazakov
2003-06-24  2:35     ` Robert I. Eachus
2003-06-24  7:35       ` Dmitry A. Kazakov
2003-06-24 10:08         ` Lutz Donnerhacke
2003-06-24 11:53         ` Georg Bauhaus
2003-06-24 12:48           ` Dmitry A. Kazakov
2003-06-26  2:54             ` Randy Brukardt
2003-06-26  6:27               ` Vinzent Hoefler
2003-06-26 12:44                 ` Georg Bauhaus
2003-06-26 13:01                   ` Vinzent Hoefler
replies disabled

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