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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9768c08202fdbbb1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-12 09:33:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!peer1.news.newnet.co.uk!zen.net.uk!news.cabal.org.uk!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Tue, 12 Nov 2002 22:29:15 +0500 References: <3dcb8347$0$299$bed64819@news.gradwell.net> Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Let's change semantics of "use type" Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3dd13b59$0$308$bed64819@news.gradwell.net> NNTP-Posting-Date: 12 Nov 2002 17:33:13 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1037122393 news.gradwell.net 308 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30765 Date: 2002-11-12T17:33:13+00:00 List-Id: In article , Robert A Duff writes: > porton@ex-code.com (Victor Porton) writes: > >> "use all type" is namely against such the packages which contain >> something other among operations on a type and also against such >> packages which define several types. >> >> Consider also packages which define operations on class wide types. >> "use"ing such a package may be dangerous as it may bring operations >> on a not supposed concrete types. > > I don't understand the problem. package P is type A_Type is ...; procedure A(X: A_Type); procedure B(I: Integer); end P; "use"ing P would bring B which is likely to conflict or to "tempt". (In real life B may be some procedure for incrementing erference counter or like.) >> Well, which dangers "use all type" has? Personally I when deal with >> a type almost always want all its primitive operations. Getting all >> primitive operations of a type seems nearly safe. > > But when you deal with a type you also want various class-wide > operations, and exceptions that are raised by primitive operations of > the type, and generic units that are related to the type, and constants > of the type. In particular, you want everything related to the type. > In other words, you want everything declared in the same package as the > type. Or, you want to use dot-selection notation. These possibilities > already exist. Yes, I forgot about class wide operations; they also should be brought to visibility by "use all type". Exceptions are commonly not multiduous, so using a prefix notation or a rename isn't a great problem with exceptions. Aproximately the same for constants. Generic units are not overloadable, so these should also be not brought to visibility, sorry for this. "use all type" much shortens the list which we need to do manually (without dangerous "use" directive).