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 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!jarthur!ucivax!ics!kolender From: kolender@ics.uci.edu (Kurt Olender) Newsgroups: comp.lang.ada Subject: Re: Unusual "use" semantics Message-ID: Date: 9 Aug 90 16:15:16 GMT References: <20@polymnia.tsd.arlut.utexas.edu> Organization: ICS Dept, UC Irvine Nntp-Posting-Host: gambetta.ics.uci.edu In-reply-to: fred@polymnia.tsd.arlut.utexas.edu's message of 8 Aug 90 21:21:51 GMT List-Id: 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. There is one other solution that hasn't been put forward that avoids both the "ugliness" of calling text_io."="(...) and the "use" clause, a rename statement, as follows: function "=" (a, b: text_io.positive_count) return boolean renames text_io."="; You may then write if (text_io.col = 1) ... and the compiler will have a visible comparison operator for positive count. I prefer this method, even though it involves more typing, because it explicitly makes visible only those things you really need to be visible, and reduces the potential name clashes that "use" can cause.