comp.lang.ada
 help / color / mirror / Atom feed
* How do I avoid 'use' in this case?
@ 1993-03-11 16:39 Val Kartchner
  1993-03-11 18:17 ` MILLS,JOHN M.
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Val Kartchner @ 1993-03-11 16:39 UTC (permalink / raw)


I know that the usage of 'use' is discouraged.  I generally agree, but I do
not see a way around it in this case.  Is there something that I'm missing?

We have a package called 'FIELD_DEF' which (among other things) defines a
variant record type and an access type for referencing it.  Here is the
text of the errors generated for one of the lines:

-- Begin included text

 2693             if (comm_addr_group(i,j) /= NULL) then
..........................................1
%ADAC-E-NOTDECLOPOPND, (1) /= is not declared for the given operands [LRM 4.5]
%ADAC-I-SUPPLOPARGTYPE, (1) Result type of the first (or only) operand of /= is
        access type field_type_ptr in field_def at line 180
%ADAC-I-POSSUSECALL1, (1) Possibly a selected component of (or use clause for)
        package field_def in field_def at line 167 is intended; this would make
        implicit binary operator /= (field_type_ptr; field_type_ptr) returning
        BOOLEAN declared in field_def at line 180 visible for a legal call

-- End included text

I followed the implied suggestion of the (VAX/VMS) Ada compiler and inserted
a "use FIELD_DEF;" statement.  I know that with non-operator functions (i.e.:
functions who's names are alphanumeric + '_'), you can use the package name
to avoid 'use'.  As far as I know, there is no equivalent for operators.

Is this true?  If not, then how do I do it?

			Thanks in advance,
				-=:[ VAL ]:=-
--
|================== #include <disclaimer.h> ==================///=============|
| "AMIGA: The computer for the creative mind" (tm) Commodore /// Weber State  |
| "Macintosh: The computer for the rest of us"(tm) Apple \\\///   University  |
|== "I think, therefore I AMiga" -- val@csulx.weber.edu ==\///= Ogden UT USA =|



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: How do I avoid 'use' in this case?
@ 1993-03-18 15:58 howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!caen!nic.umass.e
  0 siblings, 0 replies; 8+ messages in thread
From: howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!caen!nic.umass.e @ 1993-03-18 15:58 UTC (permalink / raw)


I (val@fcom.cc.utah.edu) wrote:
: I know that the usage of 'use' is discouraged.  I generally agree, but I do
: not see a way around it in this case.  Is there something that I'm missing?

Thanks to those of you who responded.  The solutions (posted and mailed) were
basically the same.  Here is the text that I used to solve it:

  function "="(LEFT,RIGHT:FIELD_DEF.FIELD_TYPE_PTR)
          return BOOLEAN
      rename FIELD_DEF."=";

I forgot that when referencing overloaded operators, you must quote them.

			Thanks again,
				-=:[ VAL ]:=-
--
|================== #include <disclaimer.h> ==================///=============|
| "AMIGA: The computer for the creative mind" (tm) Commodore /// Weber State  |
| "Macintosh: The computer for the rest of us"(tm) Apple \\\///   University  |
|== "I think, therefore I AMiga" -- val@csulx.weber.edu ==\///= Ogden UT USA =|

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1993-03-18 15:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-03-11 16:39 How do I avoid 'use' in this case? Val Kartchner
1993-03-11 18:17 ` MILLS,JOHN M.
1993-03-11 18:20 ` Erik Svensson FOA2
1993-03-16 13:12   ` Sandy Wise
1993-03-18  3:02   ` Adam Beneschan
1993-03-11 18:47 ` Arthur Evans
1993-03-12 17:26 ` Gary Morris @ignite
  -- strict thread matches above, loose matches on Subject: below --
1993-03-18 15:58 howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!caen!nic.umass.e

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