TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
X-To: Jesse Farmer <[log in to unmask]>
Date: Sat, 23 Dec 2000 10:10:09 +0100
From: Pascal Obry <[log in to unmask]>
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Parts/Attachments: text/plain (31 lines)
Jesse Farmer writes:
 > Hi again..
 > First, thanks to everyone who helped me with my question regarding sorting.
 > I'm wondering how to set the size of an unconstrained array.  Basically,
 > what I'd like to be able to do, is have an array that grows as I need it
 > to.  If this isn't possible, I'm wondering if there is any way to modify
 > the size of an array during run-time?  I really don't want to just make a
 > large array, and use that, and hope that all my data will always fit into
 > this array.

Well it looks like you are using the wrong abstraction. Why an array in this
case ? What about using a list, B-Tree, hash table...

BTW, GNAT.Table is a growing array. Look at the implementation, it uses
realloc at the low level implementation. The problem is that (as said in the
comments) this package does not support controlled objects and is GNAT



--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--| "The best way to travel is by means of imagination"