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!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!pnx.dk!news2.arglkargh.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 30 Jun 2007 13:52:22 +0200 From: Georg Bauhaus Organization: # User-Agent: Thunderbird 1.5.0.12 (Macintosh/20070509) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Bus error References: <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp> <1l4yqvxoid4n1.1u8eo4oo8ml4m$.dlg@40tude.net> <4685280c$0$14869$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4686432a$0$14873$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Date: 30 Jun 2007 13:48:58 CEST NNTP-Posting-Host: 80a96430.newsspool4.arcor-online.net X-Trace: DXC=EKDiiflW49Q[7Non7UCi8U4IUKNGS X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16350 Date: 2007-06-30T13:48:58+02:00 List-Id: Dmitry A. Kazakov wrote: > On Fri, 29 Jun 2007 21:37:43 -0400, Robert A Duff wrote: > If you have > > X1 : String renames Get_Line; > X2 : String renames Get_Line; > X3 : String renames Get_Line; > > the effect will be X1, X2, X3 all different objects. This should not be > called renaming. There happen to be no explicit arguments in the function calls. Does the same reasoning apply to X1 : String renames Get_Line(Foo); X2 : String renames Get_Line(Bar); X3 : String renames Get_Line(Baz, Mode => Frobnicate); > But when I do: > > X : Element renames Collection (Key); > > I'd like to be certain that X indeed renames a container's element. Then I think there is a problem of choosing the right name for what you have called Collection here. Ada not being a declarative language, and if Collection is a function, then the name of the function should probably indicate what the function *does* if and when you do care about how it achieves some purpose. Something like Get_From_Collection(Key) seems more likely a good name in this case. I'd agree that there is a "reading level ambiguity" in X : Data_Type renames Fun_Call_Result; and X : Fun_Decl renames Another_Fun; > package My_IO is > ... > with new Ada.Text_IO.Integer_IO (...); > -- Merge all declarations from this instance with My_Io's public > -- and private parts Which IMHO defeats the purpose of well designed packages: focus on one thing. (A two dozen years old package like Text_IO formed around various assumptions might serve to construct an exception.) Why not use interfaces when you need to lump things together? Do you have a few convincing examples that show how the decoupling of modules should be "improved" with a mechanism of merging them into one? (That is, of importing and reexporting declarations of entire packages.)