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,c703c7ba8401cbb6 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: signatures Date: 1999/07/29 Message-ID: #1/1 X-Deja-AN: 506830957 References: Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 933305054 220 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-07-29T00:00:00+00:00 List-Id: On Thu, 29 Jul 1999, Ehud Lamm wrote: > Suppose I want to ensure that a to be written set of routines all > conform to a given signatre (let's say all sort routines have the > signature > generic > type item is private; > type list is array(positive range <>) of item; > procedure sort (s:in out list); > )? > > What is the preffered way of doing this? My preferred way would be generic type Item_Type is private; type List_Type is array(Positive range <>) of Item_Type; with procedure Sort(S : in out List_Type) is <>; package Sort_Signature is end; then instantiate this with some types and a sort procedure. You can use this package as a package parameter to an implementation package like the following. generic with My_Sort is new Sort_Signature(<>); package My_Package is ... etc A very nice addition to Ada over Ada-83, these package parameters and signature packages! -- Brian