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: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Generics question Date: 1997/07/24 Message-ID: #1/1 X-Deja-AN: 258553698 Distribution: world References: <5r37k9$h4p$1@kelp.mbay.net> <5r7cvb$bfb@top.mitre.org> Organization: PSINet Newsgroups: comp.lang.ada Date: 1997-07-24T00:00:00+00:00 List-Id: In article <5r7cvb$bfb@top.mitre.org> mfb@mbunix.mitre.org (Michael F Brenner) writes: > > 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. ?!?!?? Ada95 supports passing packages to packages (generically) and one of its intended uses is for just this kind of thing (signatures with boatloads of operations). /Jon -- Jon Anthony OMI, Belmont, MA 02178 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari