comp.lang.ada
 help / color / mirror / Atom feed
From: adoyle@bbn.com (Allan Doyle)
Subject: Re: Unusual "use" semantics
Date: 9 Aug 90 14:51:17 GMT	[thread overview]
Message-ID: <58815@bbn.BBN.COM> (raw)
In-Reply-To: 20@polymnia.tsd.arlut.utexas.edu

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

  parent reply	other threads:[~1990-08-09 14:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-08-08 21:21 Unusual "use" semantics Fred Hosch
1990-08-08 22:37 ` Jim Marks
1990-08-09 12:45   ` Mike Wever
1990-08-09 15:59     ` Richard Pattis
1990-08-09  7:54 ` Rik Palo
1990-08-09 14:51 ` Allan Doyle [this message]
1990-08-09 16:15 ` Kurt Olender
1990-08-10 17:44   ` Alan Kaplan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox