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,25c6c17a48209275 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Generics question Date: 1997/07/24 Message-ID: #1/1 X-Deja-AN: 258636832 References: <5r37k9$h4p$1@kelp.mbay.net> <5r7cvb$bfb@top.mitre.org> Newsgroups: comp.lang.ada Date: 1997-07-24T00:00:00+00:00 List-Id: On 24 Jul 1997, Michael F Brenner wrote: > > To do a general numerical algorithm like you describe the Ada 95 idiom is: > > generic > > type Numeric_Type is private; > > with function "+" (X,Y : Numeric_Type) return Numeric_Type is <>; > > with function "-" (X,Y : Numeric_Type) return Numeric_Type is <>; > > with function "*" (X,Y : Numeric_Type) return Numeric_Type is <>; > > ... etc ... > > package Numerics is > > The etc is not too bad in an unnested generic package, but there is no limit > to how big it can get in nested packages, which is why Ada-200X should > consider passing packages to packages. I don't understand. Ada 95 allows you to pass an instantiation of the package Numerics to another generic package. The "etc" has to be done because Ada generics must be explicitly instantiated. Could you describe your proposal, in "pseudo-Ada", and show how it helps with this problem? I think that generic package parameters are pretty powerful, especially in combination with those signature packages. -- Brian