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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6d57164b51685c07,start X-Google-Attributes: gid103376,public From: st92j0gw@dunx1.ocs.drexel.edu (Chris Papademetrious) Subject: Package parameters in generic packages Date: 1996/07/08 Message-ID: <4rs1vn$6t8@noc2.drexel.edu>#1/1 X-Deja-AN: 167268225 organization: Drexel University newsgroups: comp.lang.ada Date: 1996-07-08T00:00:00+00:00 List-Id: I am seriously confused about how package parameters are supposed to work. Everyone is familiar with the syntax: generic with package P is new Q(<>); package X is ... end X; where a generic package itself is passed as a parameter for X so that P inherits the generic parameter that this parameter package was created with. I read in "Programming in Ada 95" by Barnes that it is a special case that when the default form (<>) is used, the formal parameter in package Q is also visible in P. Thus, if Q was defined as: generic type Real is digits (<>); package Q is .. end Q; then the type Real is able to be referenced as P.Real *inside* of X. However, I was not able to reference P.Real inside of the package body of X, only in the package *specification* of X. Is this normal? To get around this, I had to do something like this in the specification: subtype Foo is P.Real; then use this Foo type in the package body of X! Messy, messy. What am I not understanding? Incidentally, this all comes into play because I am trying to create a vectors/matrix package that supports complex numbers, but I need access to Ada.Numerics.Generic_Complex_Types.Real inside of the package for some of the vector/matrix operations. Any help appreciated. I am hoping that the entire Ada 95 community will benefit from my work when this package is released. -=-=-=-=-=-=-=-=-=-=-=-=- Chris Papademetrious Data Fusion Laboratory Drexel University Philadelphia, PA -=-=-=-=-=-=-=-=-=-=-=-=-