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!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 30 Jun 2007 19:54:55 +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> <4686432a$0$14873$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <46869822$0$14882$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Date: 30 Jun 2007 19:51:30 CEST NNTP-Posting-Host: d099b98d.newsspool4.arcor-online.net X-Trace: DXC=YbJ>jEC4b\Z=>bdbdS?M0Y4IUK Robert A Duff wrote: > > 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. Ah. In these cases I stubbornly place Int and operations in their own package. When another part of the program needs Int_Vectors in addition to Int, they are made available in an additional package. Use as needed. I'll probably write a seemingly artificial abstraction around Int_Array when I want it to be similar to Int_Vectors.Vector. (But so far have had no need to do so.)