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 X-Google-Thread: 103376,e5bfd51af02edca2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news.germany.com!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Re-exporting primitive operations of a private type (like "-", and 'min) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Mon, 31 Oct 2005 10:18:23 +0100 Message-ID: <15npz1rdb1za2.ge81hrlz9pyk$.dlg@40tude.net> NNTP-Posting-Date: 31 Oct 2005 10:18:24 MET NNTP-Posting-Host: ac7e5a9e.newsread2.arcor-online.net X-Trace: DXC=OU?;5;0U:89cbQG5oOHD^6Q5U85hF6f;4jW\KbG]kaM8Q>n?D9BSA]l;[6LHn;2LCV>7enW;^6ZC`4<=9bOTW=MN> X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:6069 Date: 2005-10-31T10:18:24+01:00 List-Id: On Mon, 31 Oct 2005 10:27:51 +0200, Niklas Holsti wrote: > Anonymous Coward wrote: >>>The whole point of private types is that the only visible operations >>>on them are assignment, equality and inequality, and any explicitly >>>defined operations in the visible part of the package >>>specification. >> >> That makes sense. As a default, it probably would be a poor language >> design to have private types automatically export public primitive >> operations. If I created an Altitude_Type, I wouldn't want to inherit >> the "+" operation. > > The following is perhaps not quite on the original topic, but this > thread reminds me of an idea for a new feature related to private > types that I would like to present. > > My Ada packages often define types that are *mostly* private in > the sense that I only want the clients to use a restricted set of > operations and properties of the type. However, I often do not > make these types actual private types because I want to reveal > some properties, such as discreteness, that I cannot now specify > for a private type. > > I would like to be able to reveal some properties of private types > in the same way as we can now define generic formal types, for > example saying that the type is discrete (type T is (<>)) or is a > modular type (type T is mod <>). [...] > Does this idea appeal to anyone? That would a repetition of the error made with generics. Instead of type Element is private (<>); it should be just type Element is new Abstract_Integer with private; which would solve everything. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de