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-Thread: 103376,9fb8e2af320d5b3e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!npeer.de.kpn-eurorings.net!npeer1.kpn.DE!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Bus error Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp> <1l4yqvxoid4n1.1u8eo4oo8ml4m$.dlg@40tude.net> <4685280c$0$14869$9b4e6d93@newsspool4.arcor-online.net> <4686432a$0$14873$9b4e6d93@newsspool4.arcor-online.net> Date: Sat, 30 Jun 2007 16:31:16 +0200 Message-ID: NNTP-Posting-Date: 30 Jun 2007 16:30:35 CEST NNTP-Posting-Host: 0702c0f9.newsspool1.arcor-online.net X-Trace: DXC=a0hO@9SDA;cFXUDVUnEXQmic==]BZ:afn4Fo<]lROoRaFl8W>\BH3Ybgf1`]Ai\9AnDNcfSJ;bb[eIRnRBaCd^0NUi On Sat, 30 Jun 2007 13:52:22 +0200, Georg Bauhaus wrote: > 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); These examples show that the concept is just wrong. The above creates some anonymous objects in background and then renames them. How to rename something that does not have any name? >> 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. Collection is a container, like an array, Key is an index. Is this better: Slice : String renames Line (10..20); >> 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.) Yes, I have examples. You can take a look at http://www.dmitry-kazakov.de/ada/fuzzy.htm and figure out how to instantiate a network of generic packages kicked off by just one actual generic parameter (floating-point type). Soon you will package that all in bundle packages like: generic -- Just instantiates things type (Number) is ...; package Bundle is package X1 is new Foo (Number); package X2 is new X1.Bar; package X4 is new X1.Baz (X2.Bar); package X5 is new X4...; ... end Bundle; These proxy packages introduce new names like X1, X2 etc which nobody actually needs. To "use" Bundle is meaningless. You have to use those Xn from there. If you have 20 generic packages and 5 different instantiation, the result is a horribly mess. I would reward with the Nobel Prize anybody who could propose a working naming convention schema for these Xn. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de