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: Generic package array parameter Date: 1999/11/12 Message-ID: #1/1 X-Deja-AN: 547873680 Content-Transfer-Encoding: 7bit References: <382255CE.F5CB679A@erols.com> To: "comp.lang.ada@list.deja.com" X-DejaID: _9S5uGRHcNJJEMX/9PSxD2b+0GQTiElci?= 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-12T00:00:00+00:00 List-Id: I am trying to rewrite generic type X is (<>); type Y is (<>); Table: array(X, Y) of X; package Foo is ... in order to circuvent the 'anonymous array definition not allowed here' constraint. I tried generic type X is (<>); type Y is (<>); Table: Table_Type; package Foo is type Table_Type is array(X, Y) of X; ... and of course got '"Table_Type" is undefined'. Then I tried generic type X is (<>); type Y is (<>); type Table_Type is array(X, Y) of X; Table: Table_Type; package Foo is ... which of course works, but is odd, and requires an equally odd instantiation: type My_X is ...; type My_Y is ...; type My_Table_Type is array(My_X, My_Y) of My_X; My_Table: My_Table_Type := (...); package My_Foo is new Foo(My_X, My_Y, My_Table_Type, My_Table); ... This works, but is ugly and stupid. Is there a smart way to rewrite it? (I feel I am again on the verge of giving up the Ada generic programming idiom. What is this Ada thing with anonymous array types?) Thanks. | | |,| | | | |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.