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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1fee5782cd952ed7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-11 11:42:01 PST Newsgroups: comp.lang.ada Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!ae From: ae@sei.cmu.edu (Arthur Evans) Subject: Re: How do I avoid 'use' in this case? In-Reply-To: val@fcom.cc.utah.edu's message of Thu, 11 Mar 93 16:39:04 GMT Message-ID: <1993Mar11.134709.13838@sei.cmu.edu> Sender: netnews@sei.cmu.edu (Netnews) Cc: val@fcom.cc.utah.edu (Val Kartchner) Organization: Software Engineering Institute References: <1993Mar11.163904.18135@fcom.cc.utah.edu> Date: Thu, 11 Mar 1993 13:47:09 EST Date: 1993-03-11T13:47:09-05:00 List-Id: val@fcom.cc.utah.edu (Val Kartchner) asks how, without a 'use' clause, to get visibility to equality and other operators on objects of a type declared in another package. Suppose you have package DEFS is type X is ... end DEFS; -- ---------------------------- with DEFS; procedure USER is P, Q: X; begin ... if P = Q ... // #1 ILLEGAL if DEFS."="(P, Q) ... // #2 Qualification to get visibility #1 is the problem you had. #2 is a way to use dot qualification of an operator. It's perhaps a bit ugly, but it works and is convenient if there are very few uses of the operator in package USER. However, there's another way to go if there are lots of uses of the operators. with DEFS; procedure USER is P, Q: X; function "="(Left, Right: in X) return boolean renames DEFS."="; begin ... if P = Q ... // Now legal Art Evans ---------------------------------------------- Arthur Evans, Jr, PhD Ada Consultant 461 Fairview Road Pittsburgh PA 15238-1933 412-963-0839 ae@sei.cmu.edu