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,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-15 05:04:36 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <3FB6244A.1010005@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" References: <3FA2CDCB.500F4AF0@fakeaddress.nil> <1068561335.260886@master.nyc.kbcfp.com> <_rGsb.39$pv1.0@read3.inet.fi> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 15 Nov 2003 13:04:35 GMT NNTP-Posting-Host: 209.165.25.181 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1068901475 209.165.25.181 (Sat, 15 Nov 2003 05:04:35 PST) NNTP-Posting-Date: Sat, 15 Nov 2003 05:04:35 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:2514 Date: 2003-11-15T13:04:35+00:00 List-Id: I tend to like a use clause for things similar to dispatching on a tagged record. Dispatching would be a joke if you *always* had to specify which package you wanted to reference, right? So there must be something "good" about the "use" clause. If I had some sort of "display (float)" and a "display (integer)" I'd like to just say "Display (Object)" and the compiler sorts it out. The "use" clause seems to be useful where you want something to appear as a primitive/intrinsic operation of some kind. At other times, I want to make it clear that I am referencing something external to the local context - lack of "use" makes that clear. I don't know that I could formulate a hard-and-fast rule as to when it is good and when it is bad, but I think the language designers had something similar to this in mind when creating it: "Sometimes you want it to look 'intrinsic' and other times you want it explicit that something is external. Hence we added the 'use' when the 'with' alone is really all that is needed." MDC Robert I. Eachus wrote: > > It can, but it doesn't always. A good example is a group of ADTs that > have display operations. The display operations belong in the package > with the other operations on the same type, but they may be the only > operation that needs to use Text_IO or some graphics packages. > > You can organize things using child packages to segregate the I/O > operations, but you end up with the display operation being the only one > to use the child package. > > Instead I usually end up with a generic package that handles the display > operations in a data independent manner, and the individual display > operations instantiate that package. Now the use clause is for a local > generic instance, but it is still there. > -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Trying is the first step towards failure." -- Homer Simpson ======================================================================