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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9fb8e2af320d5b3e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Bus error Date: Fri, 29 Jun 2007 21:37:43 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp> <1l4yqvxoid4n1.1u8eo4oo8ml4m$.dlg@40tude.net> <4685280c$0$14869$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1183167465 23231 192.74.137.71 (30 Jun 2007 01:37:45 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 30 Jun 2007 01:37:45 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:+bl/WAVUC2nxReypip6/n1qn698= Xref: g2news1.google.com comp.lang.ada:16347 Date: 2007-06-29T21:37:43-04:00 List-Id: "Dmitry A. Kazakov" writes: > You missed the point. The renaming in my example shall *not* raise > Constraint_Error. It is a clear language design fault. Right -- the fact that "X: T renames ..." completely ignores the constraints on T is a flaw. There are language-lawyerly reasons for it... > Renaming is completely broken in Ada. A little bit broken. >...It creates new objects, Heh? Renaming does not create new objects. A function call creates a new object, but that's a different story. And it's a good thing -- that function-result object might need to be finalized, which means it has to be an object (not just a value). If I ran the circus, literals would "return" objects, too. And there would be no syntactic distinction betweem "name" and "expression". >... it violates > contracts, Not sure what you mean there. I guess the fact that constraints on T are ignored, above. If so, it doesn't violate any contract, so long as you understand that "X: Positive renames..." is not a contract requiring positive numbers. ;-) >...it introduces names conflicts. Yes. We considered fixing that during Ada 9X. Here's another small complaint about renaming: It's often used as an "import", as in: function Blah (...) return ... renames Some.Library.Package.Blah; We do not wish to change the name of Blah, just to import it into another scope. But mentioning Blah twice is error-prone in that context. The programmer really wants to say something like "import Blah from Some.Library.Package". Consider: function "+"(...) return ... renames Some_Package."+"; function "-"(...) return ... renames Some_Package."+"; Note cut&paste error on second line. - Bob