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,3cd94a799504cebd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-18 11:42:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!feed.news.nacamar.de!rz.uni-karlsruhe.de!schlund.de!news.online.de!not-for-mail From: "Dr. Michael Paus" Newsgroups: comp.lang.ada Subject: Re: Small question concerning use Date: Thu, 18 Oct 2001 20:46:34 +0200 Organization: =?iso-8859-1?Q?Ingenieurb=FCro?= Dr. Paus Message-ID: <3BCF238A.3CE2A5C5@ib-paus.com> References: <19130ae.0110151428.65937d5b@posting.google.com> NNTP-Posting-Host: pd9e603c1.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.online.de 1003430554 19305 217.230.3.193 (18 Oct 2001 18:42:34 GMT) X-Complaints-To: abuse@online.de NNTP-Posting-Date: 18 Oct 2001 18:42:34 GMT X-Mailer: Mozilla 4.75 [de]C-CCK-MCD DT (Win98; U) X-Accept-Language: de Xref: archiver1.google.com comp.lang.ada:14907 Date: 2001-10-18T18:42:34+00:00 List-Id: I wonder why in these discussions about the use of "use" people always use more or less trivial examples. I think for these examples the issue is more or less a matter of taste. The real problem with "use" arrises if you make intensive use of object oriented features in Ada. E.g. if you have a package "My_Pack_A" in which you define a tagged type "My_Class_A" and another package "My_Pack_B" in which you define a tagged type "My_Class_B" which is derived from "My_Class_A". Now assume that B inherits a method "My_Method" from A. If you now have an instance of the B class and you want to call one of its methods, say B : My_Pack_B.My_Class_B; xxx.My_Method(B, Some_Value); So what is the right package name to put in for xxx? When you have found out you certainly admit that this may be quite cunfusing although there is of course a clear logic behind it. My experience is that if you intensively use object oriented features the use of "use" quickly becomes a pain in the ...:-) And if you are interested I can give you examples where in this particular case the use of "use" resulted in severe bugs in the code which were very hard to track down. Also the use of "use type" does not help here because it only makes the operators of a type but not the primitive methods of a class type visible. Michael