comp.lang.ada
 help / color / mirror / Atom feed
From: "M. A. Alves" <maa@liacc.up.pt>
To: <comp.lang.ada@ada.eu.org>
Subject: Re: Heterogenous_Array_Test
Date: Thu, 16 Aug 2001 19:06:33 +0000 (GMT)
Date: 2001-08-16T19:06:33+00:00	[thread overview]
Message-ID: <mailman.997985125.20464.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0108141912510.32177-100000@lagoa.niaad.liacc.up.pt>

So, the specific (coding) problem is fixed with type conversion:

  Child(Item(2).all).Child_Component := 22;

However, as was pointed out, that is not fully satisfactory an idiom (for
heterogenous arrays).  The really fine aproach is dispatching.  So I tried
to define dispatching procedures in the declarative part of the test
procedure---and it did not work!  Why?  Because

  *** dispatching subprograms must be defined in a package spec ***

I got this tiny but essential piece of knowledge as a warning from the
compiler (GNAT 3.13p) not before a good number of tries, so I thought I
should share it with you good folks.

_Now_ my original general problem (implementing an heterogenous array) is
solved.

Thanks all,

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150 PORTO, Portugal        mob 351+939354002






  parent reply	other threads:[~2001-08-16 19:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.33.0108141912510.32177-100000@lagoa.niaad.liacc.up.pt>
2001-08-14 19:40 ` Heterogenous_Array_Test David C. Hoos
2001-08-14 20:33   ` Heterogenous_Array_Test tmoran
2001-08-16 19:06 ` M. A. Alves [this message]
2001-08-14 20:12 Heterogenous_Array_Test M. A. Alves
2001-08-14 20:43 ` Heterogenous_Array_Test James Rogers
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox