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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada202X: Easy to use "UML private"-like components Date: Mon, 24 Jun 2013 15:07:17 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <69246de0-4b33-4d47-b5be-a45e8c911fb0@googlegroups.com> <9qrbs8l828t3pvgves504a8fm7o1c7tcpj@4ax.com> <91qcs81k6am9l3u3n19lj0b072lc48td69@4ax.com> <1im71djlxwm94$.fbjv1si7kmvj$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1372104438 10811 69.95.181.76 (24 Jun 2013 20:07:18 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 24 Jun 2013 20:07:18 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 2501 Xref: number.nntp.dca.giganews.com comp.lang.ada:182070 Date: 2013-06-24T15:07:17-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1im71djlxwm94$.fbjv1si7kmvj$.dlg@40tude.net... > On Sun, 23 Jun 2013 09:12:53 -0400, Robert A Duff wrote: > >> It is also the reason for the private part kludge: the compiler sees >> the size of the full type for a private type (assuming it is known >> at compile time). But this reasoning makes no sense to me, because >> that's not how Ada compilers work. Any reasonable implementation >> of generics and inlining needs to look at bodies. So full types >> should be in bodies, and compilers should look there (at least >> in optimizing mode) to find out their size. > > ... or there should be no generics. > > The kludge here rather is generics and inlining, both basically are macro > expansions. Or better, they can be done at bind time without any impact on what compilers look at. Bob is just plain wrong in the above -- perhaps that is how GNAT and AdaMagic works, but there is no reason that an Ada compiler has to (or *ought* to) work that way. Randy.