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: Sat, 30 Jun 2007 11:40:13 -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> <4686432a$0$14873$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1183218013 30528 192.74.137.71 (30 Jun 2007 15:40:13 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 30 Jun 2007 15:40:13 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:NpkZHgaDMHHqP6uAwSBiAG7lpx8= Xref: g2news1.google.com comp.lang.ada:16358 Date: 2007-06-30T11:40:13-04:00 List-Id: Georg Bauhaus writes: > 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.) I run across such cases fairly often. Suppose I say: package P is type Int is range 1..10; type Int_Array is array (...) of Int; ... end P; Clients that say "use P;" have visibility on two types, plus all kinds of operations on those types (such as "=" on Int_Arrays). Now suppose I want a growable array instead: with ...; package P is type Int is range 1..10; package Int_Vectors is new Ada.Containers.Vectors(Int, ...); ... end P; Now clients have to say "use P, P.Int_Vectors;" to get visibility on all the relevant operations. Or else P has to rename whole bunch of stuff. - Bob