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 Path: utzoo!mnetor!uunet!husc6!rutgers!ames!ucbcad!ucbvax!GWUVM.BITNET!MFELDMAN From: MFELDMAN@GWUVM.BITNET (Mike Feldman) Newsgroups: comp.lang.ada Subject: Sam Harbaugh's generic strings package Message-ID: <8711291623.AA07547@ajpo.sei.cmu.edu> Date: Sat, 28-Nov-87 13:23:00 EST Article-I.D.: ajpo.8711291623.AA07547 Posted: Sat Nov 28 13:23:00 1987 Date-Received: Thu, 3-Dec-87 03:23:44 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: Referring to Sam Harbaugh's program on which DEC and Alsys gave conflicting compilation verdicts, I can add to the confusion. I tried six compilers, which gave the following results: TeleSoft vers. 1.1 (VM/CMS) OK, no errors TeleSoft vers. 3.13(VAX/VMS) OK, no errors Verdix vers. 5.41 (VAX/VMS) OK, no errors Verdix vers. 5.41 (Sun/Unix) OK, no errors Meridian vers. 2.0 (MS-DOS) terminal traffic and listing follow AdaEd/C vers. 1.7.2(MS-DOS) listing follows Meridian Can someone authoritative please interpret all these results? -------------------------------------------------------------------- Meridian AdaVantage(tm) Compiler [v2.0 Jul 26, 1987] Target 8086 Package generic_strings added to library. Package body generic_strings added to library. Package body strings added to library. "weird.ada", line 27: <> illegal reference to generic "generic_strings" "weird.ada", line 31: <> missing library unit "string_operators" "weird.ada", line 34: <> type clash in parameter to "=" 40 lines compiled. 3 errors detected. -------------------------------------------------------------------- Meridian AdaVantage v2.0 Source file: weird.ada Page 1 Sat Nov 28 1987 12:50:25 1 generic 2 SIZE : POSITIVE; 3 package GENERIC_STRINGS is 4 type VARYING_STRING_TYPE is private; 5 -- This is the inner generic package that is used to make the 6 -- VARYING_STRING operators visible. 7 generic 8 package OPERATORS is 9 function "=" (LEFT : VARYING_STRING_TYPE; 10 RIGHT : VARYING_STRING_TYPE) return BOOLEAN 11 renames GENERIC_STRINGS."="; 12 end OPERATORS; 13 private 14 type VARYING_STRING_TYPE is 15 record 16 LENGTH : NATURAL := 0; 17 end record; 18 end GENERIC_STRINGS; 19 --------------------------------------- 20 package body GENERIC_STRINGS is 21 end GENERIC_STRINGS; 22 ---------------------------------- 23 with GENERIC_STRINGS; 24 package STRINGS is new GENERIC_STRINGS (132); 25 ---------------------------------- 26 with STRINGS; 27 package STRING_OPERATORS is new STRINGS.OPERATORS; ** *****E illegal reference to generic "generic_strings" ** 28 ---------------------------------- 29 with STRINGS; 30 with STRING_OPERATORS; use STRING_OPERATORS; 31 procedure L is ** *****E missing library unit "string_operators" ** 32 PDL : STRINGS.VARYING_STRING_TYPE; 33 begin 34 if PDL = PDL then null; end if; ** *****E type clash in parameter to "=" ** 35 end L; END MERIDIAN; BEGIN ADA/ED-C ---------------------------------------------------------------- NYU Ada/ED-C 1.7.2 (MS/DOS 3.0) Sat 28 Nov 1987 13:13:26 PAGE 1 1: generic 2: SIZE : POSITIVE; 3: package GENERIC_STRINGS is 4: type VARYING_STRING_TYPE is private; 5: -- This is the inner generic package that is used to make the 6: -- VARYING_STRING operators visible. 7: generic 8: package OPERATORS is 9: function "=" (LEFT : VARYING_STRING_TYPE; 10: RIGHT : VARYING_STRING_TYPE) return BOOLEAN 11: renames GENERIC_STRINGS."="; ^ *** ERROR: = not declared in GENERIC_STRINGS (RM 4.1.3, 8.3) ^ *** ERROR: invalid renaming (RM 8.5) 12: end OPERATORS; 13: private 14: type VARYING_STRING_TYPE is 15: record 16: LENGTH : NATURAL := 0; 17: end record; 18: end GENERIC_STRINGS; 19: --------------------------------------- 20: package body GENERIC_STRINGS is 21: end GENERIC_STRINGS; 22: ---------------------------------- 23: with GENERIC_STRINGS; 24: package STRINGS is new GENERIC_STRINGS (132); 25: ---------------------------------- 26: with STRINGS; 27: package STRING_OPERATORS is new STRINGS.OPERATORS; 28: ---------------------------------- 29: with STRINGS; 30: with STRING_OPERATORS; use STRING_OPERATORS; 31: procedure L is 32: PDL : STRINGS.VARYING_STRING_TYPE; 33: begin 34: if PDL = PDL then null; end if; 35: end L; 36: 2 errors detected Michael B. Feldman residence address for SNail: Professor, Dept. of EE&CS Michael B. Feldman The George Washington University 6218 Wagner Lane Washington, DC 20052 U.S.A. Bethesda, MD 20816 U.S.A. 202-994-7593 MFELDMAN@GWUVM.BITNET