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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Warts was Re: The stupidity of all the Ariane 5 analysts. Date: 1997/08/10 Message-ID: #1/1 X-Deja-AN: 263416436 References: <5qitoi$fdv$1@news.irisa.fr> <33CD6512.2404@flash.net> <01bc92e6$7a6f9e40$287b7b7a@tlo2> <33CEAF05.6389@flash.net> <33D2827B.41C67EA6@eiffel.com> <5qucs7$jie$3@flood.weeg.uiowa.edu> <33D3F2CB.61DC@flash.net> <5r4952$nca$1@flood.weeg.uiowa.edu> <33DE3CC7.2294@gsg.eds.com> <33E07E29.69CB@eurocontrol.fr> <33E7B7A5.56FF@gsg.eds.com> <5scqlr$ju@news.sei.cmu.edu> Newsgroups: comp.lang.ada Date: 1997-08-10T00:00:00+00:00 List-Id: On Sun, 10 Aug 1997, Matthew Heaney wrote: > In article , > Brian Rogoff wrote: > > > ... example deleted ...[[[[[[[[[[ > >So what do we do about this problem? There are numerous workarounds... > > > Here's one, though I haven't tried to compile it. This issue is that the > full view of the type needs to have been defined prior to instantiation of > the generics. > > ... nested package example deleted... > > Won't this solve the problem? Sure, as I said either nesting (83 or 95) or passing in the packages as formal parameters (in Ada 95) will work. If you imagine that we actually had an Ada with interleaved sections, the transformation to actual Ada consists of breaking the interleaved package into lots of little packages and instantiating them in the order that they appear in the interleaved version. That instantiation can be inside a package, if you use textual nesting, or outside, in which case you'd pass them in. > Yes, it seems that being able to interleave private and public sections > would be a convenient feature, because you could do this: Yeah, I think it would be an improvement too. I still wouldn't chuck Ada 95 over this flaw though. > generic > package AGL.Sets.Iterators is > > type Iterator is private; > > > > private > > type Iterator is ...; -- full view > > public > > > > end; > > but you can get almost that effect using nested packages. It's the same > trick you do in Ada 83 to be able to derive from a type declared in the > same package spec. As I'm a relative Ada newbie, I'm not familiar with Ada 83 tricks, only Ada 95. When I first started looking at Ada a few years ago, I knew that it must really be awful, because everyone said so. As I became more familiar with the language and its "warts", I realized that "everyone" was just like me, disparaging this language without knowing it. I find these discussions of perceived flaws and workarounds very helpful, and now I almost always end up liking Ada even more after every "wart". -- Brian