Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!bionet!apple!bbn.com!adoyle From: adoyle@bbn.com (Allan Doyle) Newsgroups: comp.lang.ada Subject: Re: Unusual "use" semantics Message-ID: <58815@bbn.BBN.COM> Date: 9 Aug 90 14:51:17 GMT References: <20@polymnia.tsd.arlut.utexas.edu> Sender: news@bbn.com Reply-To: adoyle@vax.bbn.com (Allan Doyle) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 35 In article <20@polymnia.tsd.arlut.utexas.edu> fred@polymnia.tsd.arlut.utexas.edu (Fred Hosch) writes: >My Ada compiler complains about the relation on the fourth line of the >following > > with TEXT_IO; > procedure TEST is > begin > if TEXT_IO.COL = 1 then > TEXT_IO.PUT_LINE ("COL is 1"); > else > TEXT_IO.PUT_LINE ("COL is not 1"); > end if; > end TEST; > >reporting: no operator visible for positive_count "=" universal integer. > >If I add a context clause "use TEXT_IO;" it compiles successfully. > The way we have chosen to avoid use and to avoid the ugliness of TEXT_IO."=" is by using renames: function "="(l:text_io.count;r:integer) return boolean renames text_io."="; Sometimes this can get out of hand, with a ton of renames at the top of packages or procedures but it does make it clear without cluttering up the logic once you're into the code body. Allan Doyle adoyle@bbn.com BBN Systems and Technologies Corporation (617) 873-3398 70 Fawcett Street, Cambridge, MA 02138