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 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1fee5782cd952ed7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-11 14:01:33 PST Newsgroups: comp.lang.ada Path: sparky!uunet!pipex!sunic!seunet!lin.foa.se!eriks From: eriks@lin.foa.se (Erik Svensson FOA2) Subject: Re: How do I avoid 'use' in this case? Message-ID: <1993Mar11.182021.1129@lin.foa.se> Sender: root@lin.foa.se (System PRIVILEGED Account) Nntp-Posting-Host: fenix.lin.foa.se Organization: FOA, Linkoping, Sweden References: <1993Mar11.163904.18135@fcom.cc.utah.edu> Date: Thu, 11 Mar 1993 18:20:21 GMT Date: 1993-03-11T18:20:21+00:00 List-Id: val@fcom.cc.utah.edu (Val Kartchner) writes: >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. Use rename instead. Like this: function "/="(A,B:Foo) return boolean renames field_def."/="; You could do field_def. "/="from the beginning, but that`s not so convinient. HTH cheers -- Erik Svensson Research Officer National Defense Research Establishment (FOA) Guided Weapons Division Stockholm, Sweden eriks@fenix.lin.foa.se "I like maxims that don't encourage behaviour modification." -- Calvin