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,3404439c05a9ac3 X-Google-Attributes: gid103376,public From: Mario Amado Alves Subject: Re: Generic package array parameter Date: 1999/11/23 Message-ID: #1/1 X-Deja-AN: 552014262 Content-Transfer-Encoding: 7bit References: To: "comp.lang.ada@list.deja.com" X-DejaID: _xiz/AIPid6wGj/kZxDq/cRTX6abB3tfM?= X-Authentication-Warning: lexis.di.fct.unl.pt: maa owned process doing -bs Content-Type: text/plain Organization: Deja.com - Before you buy Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-23T00:00:00+00:00 List-Id: Looking back, I was really looking for a way to make an instatiation with an array (of type named or not) *know* about its types (of the indexes and/or of the cells) in a compact way, e.g. (pseudocode): generic Table: array(<>, <>) of <>; package Foo type Index1 is Table'Index'Type(1); type Index2 is Table'Index'Type(2); type Cell_Type is Table(Index1'First, Index2'First)'Type; function Example(I: Index1; J: Index2) return Cell_Type; end; But now I've agreed to trade compactness for safety and eficiency; the thing has now compiled and it's working. Duff, thanks a lot. (Heaney, perhaps sometime I take the trouble to comment back and show the world I am not that stupid.;-) | | |,| | | | |RuaFrancTaborda24RcD 2815-249CharnecaCaparica 351+212976751 | |M|A|R|I|O| | mob 219354005 | |A|M|A|D|O| |DepartmentoInformaticFCT/UNL 2825-114Caparica 351+212958536 | |A|L|V|E|S| | fax 212948541 | | | | | | | | maa@di.fct.unl.pt FCT 212948300 Sent via Deja.com http://www.deja.com/ Before you buy.