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 Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!ucsd!nosc!helios.ee.lbl.gov!pasteur!ucbvax!MITRE-BEDFORD.ARPA!emery From: emery@MITRE-BEDFORD.ARPA (Emery) Newsgroups: comp.lang.ada Subject: Generics: 'Retraction' and an example Message-ID: <8809061331.AA11160@mitre-bedford.ARPA> Date: 6 Sep 88 13:31:28 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Earlier I said: "Furthermore, Verdix does NOT require that the body of a generic be compiled before its instantiation. It is possible to write mutually dependent generics (each generic instantiates the other) in Verdix, where most compilers will gag on such code." Wayne Wylupski and Dave Bakin replied, citing LRM 12.3(18): "Recursive generic instantiation is not allowed in the following sense: if a given generic unit includes an instantiation of a second generic unit, then the instance generated by this instantiation must not include an instance of the first generic unit (whether this instance is generated directly, or indirectly by intermediate instantiations)." They're right. You can't do recursive generic instantiation. However, here's an example of something that I can do on Verdix that DEC and (some) other compilers do not like. I believe this is legal Ada. package A is generic package B is function foo return integer; end B; end A; package body A is x : integer; package body B is separate; package my_b is new b; -- some compilers don't like this instantiation -- DEC (VMS 1.3-24) and Tartan (Sun 2.0) are two that don't -- Verdix (Sun 5.5j) compiles this just fine. begin x := my_b.foo; end A; separate (A) package body B is function foo return integer is begin return 42; -- life, the universe, and everything... end foo; end B; dave emery emery@mitre-bedford.arpa