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 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site gypsy.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!gypsy!rosen From: rosen@gypsy.UUCP Newsgroups: net.lang.ada Subject: Please Test This Message-ID: <38000023@gypsy.UUCP> Date: Thu, 3-Oct-85 13:29:00 EDT Article-I.D.: gypsy.38000023 Posted: Thu Oct 3 13:29:00 1985 Date-Received: Fri, 4-Oct-85 05:50:03 EDT Nf-ID: #N:gypsy:38000023:000:2036 Nf-From: gypsy!rosen Oct 3 13:29:00 1985 List-Id: Can someone run this small program through their Ada compiler and let me know what it has to say. I've already run it though the Verdix compiler and the Ada/ED compiler both for Unix 4.2 on a Vax. If you have a different compiler, then I'd like to know what it has to say. The error concerns the importation of the equality operator for objects that are of an access type and are declared in a different package. The Verdix compiler says that if I do not issue a "use" clause for the imported package (the one with the access type definitions), then I must qualify the "=" operator since it is not directly visible. The Ada/ED compiler doesn't require this. I believe the Verdix compiler is right since it is taking the LRM literally, but I would like to know what other compilers say. Here's the program: ---------------------------------------------------------------------------- package IMPORT_ACCESS_TYPE is type POINTER is access INTEGER; -- -- Declaration of a public access type. -- end IMPORT_ACCESS_TYPE; ---------------------------------------------------------------------------- with IMPORT_ACCESS_TYPE; -- Notice the the lack of a 'use' clause -- which is very important in this example procedure MAIN is X,Y: IMPORT_ACCESS_TYPE.POINTER; begin -- -- The compiler will/should complain about the test for equality in the -- following statement since the "=" operator is not directly visible. -- if (X = null) then Y := X; end if; -- -- The compiler should not complain about the test for equality in the -- following statement. This form is required if there is no "use" clause -- for the package which declares the access types. -- if (IMPORT_ACCESS_TYPE."=" (X, null)) then Y := X; end if; end MAIN; ---------------------------------------------------------------------------- ------------ Steve Rosen Siemens Research and Technology Laboratories Princeton, NJ USENET: {ihnp4|princeton|adrvax}!siemens!gypsy!rosen ARPA: siemens!gypsy!rosen@TOPAZ