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,a71f8d92e1423f6,start X-Google-Attributes: gid103376,public From: dommo1234@my-deja.com Subject: Generic type parameters Date: 1999/06/14 Message-ID: <7k3ae5$stk$1@nnrp1.deja.com>#1/1 X-Deja-AN: 489470547 X-Http-Proxy: 1.1 x35.deja.com:80 (Squid/1.1.22) for client 194.202.27.93 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Mon Jun 14 16:25:55 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Date: 1999-06-14T00:00:00+00:00 List-Id: This query regards generic packages, and their instantiation with some actual type. OK, I have a generic package that requires to be instantiated with a number of different types. The generic has a number of primative methods that need to return either the type that the generic package was instantiated with, an access to the type, or a constant access to the type, as in the example below :- generic type TypeX is private; package Example is function One(..) return TypeX; function Two(..) return TypeX_A; function Three(..) return TypeX_AC; end Example; ... where 'TypeX_A' needs to be "access all TypeX" and 'TypeX_AC' needs to be "access constant TypeX". The problem is that if I delcare the two types 'TypeX_A' and 'TypeX_AC' inside the generic, then any code containing variables that catch the values of functions 'Two' and 'Threee' inside my generic must be of type .Type_A etc. This is not very readable or convenient! The only (not so sensible) solution I can think of is provide the generic with 3 formal parameters, ie. TypeX, TypeX_A and TypeX_AC .... Does anyone have a neater solution to this?? Thanks, Dom. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.