comp.lang.ada
 help / color / mirror / Atom feed
From: garym@telesoft.com (Gary Morris @ignite)
Subject: Re: How do I avoid 'use' in this case?
Date: Fri, 12 Mar 1993 17:26:57 GMT
Date: 1993-03-12T17:26:57+00:00	[thread overview]
Message-ID: <1993Mar12.172657.23697@telesoft.com> (raw)
In-Reply-To: 1993Mar11.163904.18135@fcom.cc.utah.edu

In <1993Mar11.163904.18135@fcom.cc.utah.edu> val@fcom.cc.utah.edu (Val Kartchner) writes:
>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:

> 2693             if (comm_addr_group(i,j) /= NULL) then
>..........................................1
>%ADAC-E-NOTDECLOPOPND, (1) /= is not declared for the given operands [LRM 4.5]

>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.

This is not true, you can qualify operators with the package name.  We
mostly consider it not very readable so we use renames of the operator
instead. 

Either of these will work:
	
	if Field_Def."/="(comm_addr_group(i,j), NULL) then

Or add this rename in your package to allow your original code above to work,
this makes the "=" (and implicitly the "/=") operators visible (replace
Record_Type_Name with the actual name of the type):

    function "="(L,R: Field_Def.Record_Type_Name) return Boolean
      renames Field_Def."=";

        if comm_addr_group(i,j) /= NULL then

--GaryM
-- 
Gary Morris                      Internet: garym@telesoft.com
TeleUSE Development              UUCP:     uunet!telesoft!garym
Alsys Group (TeleSoft)           Phone:    +1 619-457-2700
San Diego, CA, USA               Fax:      +1 619-452-1334



  parent reply	other threads:[~1993-03-12 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- 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
replies disabled

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