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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa2cc518ef3b992c X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: Re: tagged types extensions - language design question Date: 2000/01/31 Message-ID: #1/1 X-Deja-AN: 579858214 References: Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 2000-01-31T00:00:00+00:00 List-Id: Matthew Heaney wrote in message ... > >If you're trying to declare public and private attributes, then you're >going to have to declare (abstract) intermediate types. Yes, this >carries a syntactic burden, but we disagree about its severity. > >In any kind of design problem (here, the design of a computer language), >one rule of thumb is "design for the common case." In other words, >common things should be easy to do. Don't make the uncommon case easy, >if that means making the common case harder. > >As Tucker pointed out, declaring an abstraction with both public and >private attributes is not a common thing to do, and so they didn't >design for that case specifically. This keeps the language simple. > >Yes, as a consequence, in this particular case you have to work a little >harder in order to implement the abstraction, but you can get the job >done. Yes, as a matter of fact this is not a big deal. Actually everything needed could be declared in one package. One need just to remember the right sequence - first to declare abstract public extension of the root type, then it's abstract private extension and then concrete final extensions (in my case two of them). Very similar to the case when one wants to declare deallocation procedure for some private type in the same package where this private type is declared. Here right sequence is also very important and might be even less obvious for those who encounter that need for the first time. In fact it is a little bit surprising when you first time encounter this tagged type extension restriction but when you get used to it does not seem that unusual. Now when I get used to it I feel nothing strange about that. Thanks to all who responded. Others point of view is always very useful. Sometimes it is a little bit difficult to overcome thinking inertia in adopting some things that seem strange at a first glance. Regards, Vladimir Olensky