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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e3f2eac5c026e3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-28 11:48:46 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!dialin-145-254-043-247.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Other Ada Standards (was Re: SIGada Conference) Date: Sun, 28 Dec 2003 20:55:07 +0100 Organization: At home Message-ID: References: <468D78E4EE5C6A4093A4C00F29DF513D04B82B08@VS2.hdi.tvcabo> <3FE991DD.5060301@noplace.com> <3FEA5C82.8050309@noplace.com> <3FEB047A.1040100@noplace.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-043-247.arcor-ip.net (145.254.43.247) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de 1072640925 15338700 145.254.43.247 ([77047]) User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:3898 Date: 2003-12-28T20:55:07+01:00 List-Id: Robert I. Eachus wrote: > Dmitry A. Kazakov wrote: > >> With/use issue is rather a cosmetic one. It might be very important for >> language promoting, though for those who are using Ada on daily basis, it >> is uninteresting, yet. Another very important cosmetic thing, (Robert >> Eachus and me mentioned it before) could be an ability to bundle a set of >> with's and use's in one package with then could be with-ed / used-ed >> instead. > > Not me! Unless I mentioned that I often do just that, but in a > different way. If I am composing several ADTs to create a type I > certainly will do: > > with A; with B; with C; > package Multiple is > > type ADT is ... > > package New_A is new A(ADT); > package New_B is new B(ADT); > package New_C is new C(ADT); > > function ... renames New_A... > procedure ... renames New_B... > ... > > end Multiple; > > Now for types that use the ADT, I only have to say: > > with Multiple; > > of course I will often follow it with: > > use type Multiple.ADT; > > to make the interesting subset of the declarations in ADT visible. (If > I need one of the uncommon operations from one of the instances, I will > either use dotted notation or a use clause in some nested scope.) > >> And these cosmetic things are about >> >> - information hiding, >> - refactoring, >> - reuse >> >> of declarations. Isn't it more than just an issue of training a text >> editor? > > Yes, it is. But what does it mean if you have a large set of unrelated > packages withed by a large number of different units? Bad design. Right. But if they are related? Deeply nested generic child units? Does not the language encorage designers to use larger compilation units because otherwise users will be "punished" by larger with/use blocks? > So > adding something to the language to make it easier for bad designers to > implement their designs, and harder on the readers than the bad design > would otherwise be is not something we want to do. I think that we have reached the level of complexity where it becomes a heavy burden for a reader to analyze all with's and use's. Tools might help, but there is still a problem. > Now look at what I did above, and think about interfaces. Interfaces > will make it easier to aggregate related units and when interfaces are > used to implement the above pattern, and will make it even easier on the > reader. Unless there is a with for one of the instances used to > implement an instance of an interface, the reader only needs to > understand the interface to understand a unit where an interface > instance is withed. True, this the same problem, but it is one level beneath. You are talking about type interfaces, with/use issue is sort of "package interfaces". With type interfaces and abstract types we can hide uninteresting details. Probably it is time to go this way for packages. > This is what I meant when I said that I think that adding interfaces to > Ada will be a big benefit without considering multiple inheritance. > Interfaces make it easier for a writer to communicate his intentions to > readers. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de