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
Condense Mail Headers

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

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
X-To:
Stephane Richard <[log in to unmask]>
Date:
Mon, 15 Oct 2001 17:54:58 -0400
Reply-To:
Subject:
From:
Jack Beidler <[log in to unmask]>
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset=us-ascii
Organization:
University of Scranton
MIME-Version:
1.0
Parts/Attachments:
text/plain (46 lines)
Regarding:

Stephane Richard wrote:

> Just a quick question about Ada95.  Is there such a thing as a Collection
> Object, or an equivalent data structure that would allow me to do the
> following, for example.  Either included in Ada, or coded and available somewhere as a
> library.
>
> Create the collection
>
> TYPE Integer_List IS COLLECTION OF Integer (or something similar).

I'm not sure why you would want to do that.  Use Ada's generic packaging, which is
somewhat analogous to C++ templates and Generic Java (PolyJ).

>
>
> This_List : Integer_List;
>
> ThisList.Add 12
> ThisList.Add 24
>
> ThisList.Delete 2  -- DELETE second element added to the collection.
>
> and other features to allow to manipulate this list of whichever type I
> choose.  In this example it's a list of integers.  But it could be a list of
> records, a list of packages (if possible), a list of pretty much anything
> available to the Ada95 Language.

There are several sources of data structure packages in Ada, you can find the Booch
components, or the packages I have used for years at

http://www.cs.uofs.edu/~beidler/Ada/index.html

Jack Beidler
--
John (Jack) Beidler, Ph.D., Professor of Computer Science
Computing Sciences Department
University of Scranton
Scranton, PA 18510
- - - - - - - - - - - - - - -
Voice: (570)941-7774  FAX: (570)941-4250
Email: [log in to unmask]
Web:   http://www.cs.Scranton.edu/~beidler

ATOM RSS1 RSS2