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.ams.giganews.com!nntp.giganews.com!news2.euro.net!newsfeed.freenet.ag!feeder.erje.net!eu.feeder.erje.net!nuzba.szn.dk!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: Tue, 25 Jun 2013 14:06:03 -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> <206y6i0kct3w$.mhlovb1s5pey.dlg@40tude.net> <12c0h7muc9ab1$.1rn058nrhw3m8.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1372187164 21224 69.95.181.76 (25 Jun 2013 19:06:04 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 25 Jun 2013 19:06:04 +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 Xref: number.nntp.dca.giganews.com comp.lang.ada:182081 Date: 2013-06-25T14:06:03-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:12c0h7muc9ab1$.1rn058nrhw3m8.dlg@40tude.net... > On Mon, 24 Jun 2013 15:11:11 -0500, Randy Brukardt wrote: > >> "Dmitry A. Kazakov" wrote in message >> news:k32sqc8hss4r$.14d3n8qneksz7$.dlg@40tude.net... >> ... >>> 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". >> >> You don't need the body even if you *do* "expand" (as Ada does). The Ada >> contract model is strict enough that universal code sharing works (and >> the >> contract model could be stronger still). > > Here is a logical contradiction. If the model were that strong you would > need no bodies to look into, the public part declaration should be enough > for using the type. I'm not talking about the public part only; I'm definitely including the private part as well. > But the model is not enough strong and it is not enough precise. You can > write > > type T is private; > > and there is no contract put on T'Size. Without that contract you cannot > have > > type A is array (...) of T; Of course you can have that. Janus/Ada uses universal code sharing, so if T is a formal private type, you have precisely this situation -- and it works fine. The compiler simply has to insert a level of indirection; the programmer need not know that it is there -- the compiler can manage it for you (including all of the memory management). Just as with mutable discriminanted records, there is no reason that the complications have to be made visible to the programmer. This is not done more mostly because compiler writers don't want the extra work. They don't much care that not having these features makes more work for the programmer, and so long as programmers don't demand this support, they aren't going to get it. (The excuse for not providing it is that systems that have strong verification requirements can't have the implicit allocation and deallocation that is implied. I suppose that's true, but even then why should the support be denied to everyone else?). ... > 2. You must have private part available for the compiler to deduce missing > information. I was certainly assuming this in my original response. I'm not sure why you thought otherwise, as I was clearly talking about in current Ada and paying little attention to whatever Bob was talking about (it's misguided at best). Randy.