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-18 14:45:22 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: Tue, 18 Nov 2003 22:45:21 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <3FA2CDCB.500F4AF0@fakeaddress.nil> <1068561335.260886@master.nyc.kbcfp.com> <_rGsb.39$pv1.0@read3.inet.fi> <3FB6244A.1010005@noplace.com> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1069195521 16509 134.91.1.34 (18 Nov 2003 22:45:21 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Tue, 18 Nov 2003 22:45:21 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: archiver1.google.com comp.lang.ada:2659 Date: 2003-11-18T22:45:21+00:00 List-Id: Marin David Condic wrote: : I tend to like a use clause for things similar to dispatching on a : tagged record. : "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." : :> 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. Thanks for the ideas, I'll try them in modules that produce two different kinds of textual representation of some data structures, maybe by inspecting the data or maybe having the data print themselves. Georg