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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af3dada69080e420 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-25 03:25:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news-lei1.dfn.de!news-mue1.dfn.de!news-nue1.dfn.de!newsfeed.r-kom.de!fu-berlin.de!uni-berlin.de!dialin-145-254-043-044.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Interesting effects in array renaming Date: Wed, 25 Jun 2003 12:28:26 +0200 Organization: At home Message-ID: References: <3EF5E6B8.3030203@spam.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-043-044.arcor-ip.net (145.254.43.44) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1056536741 28787176 145.254.43.44 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:39714 Date: 2003-06-25T12:28:26+02:00 List-Id: Georg Bauhaus wrote: > Dmitry A. Kazakov 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