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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3dbf2f325f33ce35 X-Google-Attributes: gid103376,public From: dkristol@see-my.sig (David Kristola) Subject: Re: Elimination of "use" clauses Date: 1999/07/20 Message-ID: <7n0jrj$n5r1@svlss.lmms.lmco.com>#1/1 X-Deja-AN: 502953157 Distribution: world References: Organization: LockMart Reply-To: dkristol@see-my.sig Newsgroups: comp.lang.ada Date: 1999-07-20T00:00:00+00:00 List-Id: dale@cs.rmit.edu.au (Dale Stanbrough) writes: >Richard D Riehle wrote: > >" >Good point. I wouldn't mind having a concise way of saying (eg) "T is > >an integer type with just "+" and "-" operators. But I still prefer > >"use type" to "package Ops". > > We agree up to a certain point. Explicit export directives would > solve the problem, but that is not currently part of Ada. Again, > "use type" is too broad, I think. " > > >Export directives -could- do it (and it is not a bad idea at all), >but we shouldn't forget that Ada already has the ability to export >-just- the operators we want, and it's called using a private type >and only advertising the appropriate operations. > >However this has the disadvantage that you can't use the private >type in all the places that you might want to use an integer type. > >Dale Can't "abstract" be used to remove the unwanted operators from the original package? function "*"(Left, Right : T) is abstract; -- eliminate multiplication --djk, keeper of arcane lore & trivial fluff Home: David95037 at aol dot com Spam: goto.hades@welovespam.com