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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada202X: Easy to use "UML private"-like components Date: Mon, 24 Jun 2013 09:16:34 +0200 Organization: cbb software GmbH Message-ID: References: <69246de0-4b33-4d47-b5be-a45e8c911fb0@googlegroups.com> <9qrbs8l828t3pvgves504a8fm7o1c7tcpj@4ax.com> <91qcs81k6am9l3u3n19lj0b072lc48td69@4ax.com> <1im71djlxwm94$.fbjv1si7kmvj$.dlg@40tude.net> <206y6i0kct3w$.mhlovb1s5pey.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: IenaDxMXK2hi7fvYcb+MlQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:15918 Date: 2013-06-24T09:16:34+02:00 List-Id: On Sun, 23 Jun 2013 19:38:47 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> On Sun, 23 Jun 2013 11:15:15 -0400, Robert A Duff wrote: >> >>> "Dmitry A. Kazakov" writes: >>> >>>> ... or there should be no generics. >>>> >>>> The kludge here rather is generics and inlining, both basically are macro >>>> expansions. >>> >>> Semantics defined by macro-expansion is confusing, and should be >>> avoided. I'd prefer to have generic types rather than generic >>> packages, and don't use macro-expansion semantics. >> >> Still macro expansion it is (if meant as textual substitution). > > No, as I said above, "don't use macro-expansion semantics"! > One can have "Sequence of Integer" and "Sequence of Whatever" > without any macro-expansion/textual-substitution semantics. > And with full type safety (can't pluck a Mumble out of a > "Sequence of Integer"). > >> It is no matter how you reinterpret the expanded text: as a package, as a >> type, as a statement, identifier, declaration etc. Generic types would be >> no better than generic packages. > > There should be no "expanded text" in my view. Maybe that's what > you mean when you say "no generics", but then you should say > "no Ada-style generics" (or C++-style templates). OK, but if not "expansion" then Ada already has such types: discriminated subtypes and tagged types. Both are dynamically parametric types. Neither requires looking into the bodies. Maybe they could be augmented in order to deal with more complex kinds of parametrization, e.g. for container types (sequence of Integer indexed by String). But again, please, without opening up the bodies. You don't need the body unless you "expand". -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de