comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Interesting effects in array renaming
Date: Wed, 25 Jun 2003 12:28:26 +0200
Date: 2003-06-25T12:28:26+02:00	[thread overview]
Message-ID: <bdbtb4$regf8$3@ID-77047.news.dfncis.de> (raw)
In-Reply-To: bd9npr$mm8$1@a1-hrz.uni-duisburg.de

Georg Bauhaus wrote:

> 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".

But the "usual" meaning of "renames" is:

   p : renames a;

What meaning has Orange in renaming? Just a buzz word? Then I would propose 
to change the syntax to

   p: Orange or else renames a;

It would perfecly reflect the present semantics! (:-))

What I want is:

   p: Orange and then renames a;

> : 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.

It imposes a constraint on people calling you. That is the point. Consider 
renaming Mr.Smith to Mrs.Smith. Authorities in most contries would object, 
even if Mr.Smith had undergone a surgery. [Though, I could have missed the 
recent advances in "poltical correctness" and could be wrong] (:-))

> That's renaming for me.
> It won't even change the sound of my name ;-)

I give you another example. When you rename a routine:

   procedure Baz (A : Apple);
   procedure Foo (B : Apple) renames Baz;

the compiler checks the specified parameter profile. According to your 
theory it should not. Indeed

   procedure Foo (B : Orange) renames Baz;

by no means changes Baz.

> : 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.

Oh, that's is the very C++ ideology to me:

"Wished it? Take it, idiot!" (:-))

-- 
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2003-06-25 10:28 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
2003-06-25 10:28               ` Dmitry A. Kazakov [this message]
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