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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Generics question Date: 1997/07/23 Message-ID: #1/1 X-Deja-AN: 258262143 References: <5r37k9$h4p$1@kelp.mbay.net> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-07-23T00:00:00+00:00 List-Id: Skip Carter says << I have a computational algorithm that I've implemented that has the (admitedly unusual) property that it is perfectly valid for either arrays of Integers or arrays of Floats. As far as I can see I CANNOT make a generic version of the package that will work for both, e.g.: Generic Type Element is Type DataArray is Array(Natural Range<>) of Element; >> No problem, just make the generic formal type private, and then require the user (by default if convenient) to pass in the set of operators you require, i.e. put statements like with "+"(L,R : Element) return Element That will work fine.