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 X-Received: by 10.14.219.131 with SMTP id m3mr2362729eep.6.1389827866324; Wed, 15 Jan 2014 15:17:46 -0800 (PST) MIME-Version: 1.0 From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: 'Protected' abstract subprograms Date: Wed, 15 Jan 2014 17:17:46 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <839fee13-2743-49f6-a7f3-f95578386201@googlegroups.com> <1aav8alqsnqqv.5urmifgwh1mv.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1389827866 10559 69.95.181.76 (15 Jan 2014 23:17:46 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 15 Jan 2014 23:17:46 +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 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!bc7no8446498wib.1!news-out.google.com!f14ni4850wiw.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail X-Original-Bytes: 2938 Xref: number.nntp.dca.giganews.com comp.lang.ada:184439 Date: 2014-01-15T17:17:46-06:00 List-Id: "Robert A Duff" wrote in message news:wcck3e18he0.fsf@shell01.TheWorld.com... > "Dmitry A. Kazakov" writes: ... >> Just one trivial example of slack privacy. You cannot hide default >> values: >> >> type T is private; > > If you have: > > function V return T; > > then the default value is hidden. Or of course you can use a deferred constant, again the value isn't visible. V : constant T; It's mildly unfortunate that this latter and the former aren't semantically equivalent (they should be), but that doesn't have much to do with the point. Dmitry might be wanting to hide the *name* of the value, but that's a silly thing to do. Most of the time, people want *more* access to these things, not less. If we did provide a way to hide the name of the value, we'd also have to provide a way to get the name without using the name: Foo.X'Default Which is just a lot more complex way of making that name visible in your interface. All it would do is add a lot more language complexity. (This problem has come up repeatedly in Ada; the most recent one is a request to access the Default_Value for a type; there is no such mechanism in Ada 2012, in large part because what the value ought to be for a type that doesn't have Default_Value specified is uncertain.) Ada might have cases of "slack privacy", but I don't think this is one of them. Randy.