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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9677a3433b89e25b X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: attributes in generic procedure Date: 1999/11/29 Message-ID: <81u30o$i4c$1@nnrp1.deja.com>#1/1 X-Deja-AN: 554411881 References: <818esd$t6l$1@nnrp1.deja.com> <383DC78E.63A556E5@callnetuk.com> <3841CE51.862ACED3@icon.fi> X-Http-Proxy: 1.0 x31.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Nov 29 14:36:08 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-11-29T00:00:00+00:00 List-Id: In article <3841CE51.862ACED3@icon.fi>, Niklas Holsti wrote: > In fact, there is no formal_scalar_definition in the RM. I, > too, would have liked to have one when I recently wrote a > generic function to take the maximum value of a vector of some > generic element type. For good reason! How would one compile shared code for such a case? Answer you would have to pass in all possible operations. Given that this is the case, you can achieve this result yourself, either with a specific list of generic operators, or with a formal generic package containing the required operations. The built in formal types in generics are quite deliberately limited to those that can be handled efficiently in shared code. Remember that you can always do anything you want with formal private types by passing in the operations that are needed. The built in formal types allow a simplification in the cases where the set of built in types is the same across a class of types and therefore do not need to be passed in. Sent via Deja.com http://www.deja.com/ Before you buy.