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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.157.198 with SMTP id g189mr6406420ioe.38.1499128226415; Mon, 03 Jul 2017 17:30:26 -0700 (PDT) X-Received: by 10.36.26.134 with SMTP id 128mr913756iti.3.1499128226381; Mon, 03 Jul 2017 17:30:26 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!188no991414itx.0!news-out.google.com!k7ni7747itk.0!nntp.google.com!v202no928529itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 3 Jul 2017 17:30:26 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=137.103.119.68; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 137.103.119.68 References: <82a59ee9-8d55-4c73-9daf-e9f7d9ab8a8f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: derived formal types and known discriminants From: sbelmont700@gmail.com Injection-Date: Tue, 04 Jul 2017 00:30:26 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:47271 Date: 2017-07-03T17:30:26-07:00 List-Id: On Friday, June 30, 2017 at 2:10:01 PM UTC-4, Randy Brukardt wrote: >=20 > Sure, but they're very inflexible in that usage (as bad or worse than the= =20 > original unconstrained types). So I tend to view these as an either/or=20 > proposition: untagged, mutable types with discriminants, or tagged types= =20 > without discriminants. Again, YMMV. >=20 At the risk of having some of the other thread's shade thrown in here, aren= 't tagged discriminated records the de facto way of doing initialization? = That is, extending a Controlled type and then using discriminants in place = of ctor arguments? I can see that a "real" discriminated record (i.e. vari= ant records) probably have little use in a tagged hierarchy, but access dis= criminants (et al) seem much closer to 'constant record elements' than a tr= uly discriminated record. After all, how else is one supposed to do construction for an abstract pare= nt type? In C++, for example, an abstract type still has a constructor (th= at all children would have to explicitly call with the required arguments),= but in Ada 'constructing functions' are off the table since the type is ab= stract. So apparently the only thing left is to use Initialize and then fe= rry any required arguments over as discriminants? This is the method given= in many texts and examples, so please set me straight if i'm way off base. Thank you again to everyone for the helpful comments and continued support. -sb