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!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!hasan From: hasan@ut-emx.uucp (David A. Hasan) Newsgroups: comp.lang.ada Subject: Re: factoring with generics Message-ID: <45647@ut-emx.uucp> Date: 15 Mar 91 17:39:23 GMT References: <45358@ut-emx.uucp> <45441@ut-emx.uucp> Organization: UTexas Center for Space Research List-Id: In response to a question I asked about using a generic subprogram in the body of a package to implement the bodies of various subprograms exported by that package, loftus@wpllabs.UUCP (William Loftus) writes: >A generic instantiation introduces both a spec and body ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (I see...) >(see 12.2(1) and 12.2(2)). A generic instantiation of a procedure in a >package body introduces a spec and body for that routine into the package >body. If there is a specification of a homograph in the package >specification then there is a redeclaring of the specification of the >subprogram in the package body, and therefore is illegal. However, this >has been submitted by ALWG as a consideration for Ada 9x. > Thank you. The answers my question exactly. I must admit, however, that I still can't see how those two paragraphs of the LRM tell me this. Do you perhaps mean 12(1) and 12(2)? When it says "An instance of a generic subprogram is a subprogram", is it really telling me that a spec and body are generated? My confusion was doubled by the fact that the Meridian compiler which I also use actually compiled what DEC's wouldn't (although I did get a runtime PROGRAM_ERROR). >Also notice that you cannot use a renames solely as an implemenation, >either. Yes, I've tried that in the past and had to mend my ways, also. Is there a 9X consideration of that? Anyway, thanks for the help! -- | David A. Hasan | hasan@emx.utexas.edu