TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Pascal Obry <[log in to unmask]>
Reply To:
Date:
Sat, 23 Dec 2000 10:10:09 +0100
Content-Type:
text/plain
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
specific.

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"

ATOM RSS1 RSS2