comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: List container: Sawdust woman 43
Date: Thu, 15 Nov 2001 04:29:42 GMT
Date: 2001-11-15T04:29:42+00:00	[thread overview]
Message-ID: <3BF344AD.42FCB303@acm.org> (raw)
In-Reply-To: 9sucit$qde$1@nh.pace.co.uk

Marin David Condic wrote:
> 
> I think we might be able to get volunteers to add the extensions under the
> supervision of the library's "owner". If its BC's, would Simon be willing to
> supervise/coordinate the changes? If its PragmARC, would Jeffery be willing
> to volunteer for this duty?

The important thing is to have a workable standard library. I'm not
completely in favor of some of the choices made in the current standard
library, but having a standard is better what we had with Ada 83.

If the PragmARCs can serve as a basis for any of the components in such
a library, PragmAda would be proud to assist in the process. If another
form of components is chosen for a standard library, PragmAda would
welcome that. However, we would not consider the adoption of a standard
component based on the PragmARCs as "extending" the library; rather, we
would eliminate the equivalent component from the PragmARCs, as we
eliminated the variable-string component that was in the Ada-83 version
from the Ada-95 version of the components with the introduction of the
standard string libraries. Ideally, we would like to eliminate all the
basic components from the PragmARCs.

Let me try an experiment. I'll append the entire specification of
PragmARC.List_Unbounded_Unprotected to this message (the exception
Storage_Exhausted is defined in the root package PragmARC). I would like
to know who would refuse to use a standard component derived from this
package through modest modifications. For those who would be willing to
use such a component, what would be the minimal set of changes you would
require before using the component?

I'll help shorten the process by listing some changes I think we've
already reached consensus on here:

The package name will be different (but we haven't decided what it will
be yet). I would not expect a standard list package to be named
PragmARC.Anything.

The imported type Element will be private; the imported procedure Assign
will be eliminated.

Handle (the list type) will be private, with Adjust and "=" defined to
produce a deep copy and meaningful equality.

Any objections that enough people agree on could then be incorporated to
produce an acceptable specification for a standard list package. No one
would be entirely satisfied with the resulting package (obviously I
wouldn't), but perhaps we could reach consensus that it could be the
standard list. If the list of common objections is long, then this is
not a suitable starting point for a standard list package.

-- 
Jeffrey R. Carter
PragmAda Software Engineering

Listing follows; please bear with unavoidable reformatting by
newsreaders:

-- PragmAda Reusable Component (PragmARC)
-- Copyright (C) 2001 by PragmAda Software Engineering.  All rights
reserved.
--
**************************************************************************
--
-- General purpose list for sequential use
-- A list has elements in sequence; each element has a position in that
sequence
-- Positions are used to manipulate a list
--
-- History:
-- 2001 May 01     J. Carter          V1.1--Added Is_Empty
-- 2000 May 01     J. Carter          V1.0--Initial release
--
with Ada.Finalization;

use Ada;
generic -- PragmARC.List_Unbounded_Unprotected
   type Element is limited private; -- Do not instantiate with a scalar

   with procedure Assign (To : in out Element; From : in Element) is <>;
package PragmARC.List_Unbounded_Unprotected is
   pragma Preelaborate;

   type Handle is limited private; -- Initial value: empty

   type Position is private;
   -- A position is initially invalid until assigned a value by First,
Last, or Off_List
   -- Other positions accessible via Next and Prev

   Invalid_Position : exception; -- Raised if a position is invalid or
if the Off_List position is used for Delete, Get, or Put

   procedure Clear (List : in out Handle); -- Makes List empty

   -- Operations to obtain valid positions for lists:
   function First    (List : Handle) return Position; -- The position of
the first item in List
   function Last     (List : Handle) return Position; -- The position of
the last  item in List
   function Off_List (List : Handle) return Position;
   -- Next (Last (List), List) and Prev (First (List), List) refer to
positions which are "off the list"
   -- This special position is used in those cases
   -- Each list has a unique Off_List position
   -- Next (Last (List), List)  = Off_List (List)
   -- Prev (First (List), List) = Off_List (List)
   --
   -- Next and Prev are supposed to reverse each other
   -- For a valid Position P of Handle L, Next (Prev (P, L), L) = P and
Prev (Next (P, L), L) = P
   -- This gives us:
   -- Next (Off_List (List), List) = First (List)
   -- Prev (Off_List (List), List) = Last (List)
   --
   -- A similar relation holds for Insert and Append:
   -- Insert (List, X, Off_List (List), P) <=> Append (List, X, Last
(List), P)
   -- Append (List, X, Off_List (List), P) <=> Insert (List, X, First
(List), P)
   --
   -- If List is empty, Off_List (List) = First (List) = Last (List)
   -- The Off_List position cannot be used for Delete, Get, or Put
   --
   -- Time: O(1)

   -- Operations to obtain valid positions from valid positions:
   function Next (Pos : Position; List : Handle) return Position; --
raise Invalid_Position
   function Prev (Pos : Position; List : Handle) return Position; --
raise Invalid_Position
   -- Next and Prev raise Invalid_Position if Pos is invalid
   --
   -- Time: O(1)

   -- Operations to manipulate lists
   procedure Insert (Into : in out Handle; Item : in Element; Before :
in Position; New_Pos : out Position);
   -- Inserts Item before Before
   -- Returns the position of Item in Into in New_pos
   -- Raises Storage_Exhausted if no more storage is available for Into
   -- Raises Invalid_Position if Pos is invalid
   -- Nothing is changed if Storage_Exhausted or Invalid_Position are
raised
   --
   -- Time: O(1)

   procedure Append (Into : in out Handle; Item : in Element; After : in
Position; New_Pos : out Position);
   -- Appends Item after After
   -- Returns the position of Item in Into in New_Pos
   -- Raises Storage_Exhausted if no more storage is available for Into
   -- Raises Invalid_Position if Pos is invalid
   -- Nothing is changed if Storage_Exhausted or Invalid_Position are
raised
   --
   -- Time: O(1)

   procedure Delete (From : in out Handle; Pos : in out Position); --
raise Invalid_Position
   -- Deletes the item at Pos
   -- Pos is made invalid
   -- Raises Invalid_Position if Pos is invalid or is the Off_List
position for From
   -- Nothing is changed if Invalid_Position is raised
   --
   -- Time: O(1)

   function Get (From : Handle; Pos : Position) return Element; -- raise
Invalid_Position
   -- Returns the item at Pos
   -- Raises Invalid_Position if Pos is invalid or the Off_List position
   --
   -- Time: O(1)

   procedure Put (Into : in out Handle; Pos : in Position; Item : in
Element); -- raise Invalid_Position
   -- Makes the Element stored at Pos be Item
   -- Raises Invalid_Position if Pos is invalid or is the Off_List
position for Into
   -- Nothing is changed if Invalid_Position is raised
   --
   -- Time: O(1)
   
   function Is_Empty (List : Handle) return Boolean;
   -- Returns True if List is empty [Length (List) = 0]; returns False
otherwise
   --
   -- Time: O(1)

   function Length (List : Handle) return Natural; -- Returns a count of
the number of items in List
   --
   -- Time: O(N)

   generic -- Iterate
      with procedure Action (Item : in out Element; Pos : in Position;
Continue : out Boolean);
   procedure Iterate (Over : in out Handle);
   -- Calls Action with each Element in Over, & its Position, in turn
   -- Returns immediately if Continue is set to False (remainder of Over
is not processed)

   generic -- Sort
      with function "<" (Left : Element; Right : Element) return Boolean
is <>;
   procedure Sort (List : in out Handle); -- raise Storage_Exhausted
   -- Sorts List into ascending order as defined by "<"
   -- Requires one additional list node
   -- Raises Storage_Exhausted if no more storage is available for this
extra node
   -- List is unchanged if Storage_Exhausted is raised
   --
   -- Time: O(N log N)
private -- PragmARC.List_Unbounded_Unprotected
   ...
end PragmARC.List_Unbounded_Unprotected;
--
-- This is free software; you can redistribute it and/or modify it under
-- terms of the GNU General Public License as published by the Free
Software
-- Foundation; either version 2, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful, but
WITH
-- OUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License
-- for more details. Free Software Foundation, 59 Temple Place - Suite
-- 330, Boston, MA 02111-1307, USA.
--
-- As a special exception, if other files instantiate generics from this
-- unit, or you link this unit with other files to produce an
executable,
-- this unit does not by itself cause the resulting executable to be
-- covered by the GNU General Public License. This exception does not
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.



  reply	other threads:[~2001-11-15  4:29 UTC|newest]

Thread overview: 189+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-10  3:51 List container strawman 1.2 Ted Dennison
2001-11-10  4:20 ` Jeffrey Carter
2001-11-10  4:59   ` Ted Dennison
2001-11-10 11:14 ` Florian Weimer
2001-11-10 16:24   ` Ted Dennison
2001-11-10 17:39     ` Florian Weimer
2001-11-10 18:31       ` Ted Dennison
2001-11-10 18:45         ` Jean-Marc Bourguet
2001-11-10 22:44           ` Ted Dennison
2001-11-11  3:59             ` Steven Deller
2001-11-11 11:29               ` Jean-Marc Bourguet
2001-11-11 17:42                 ` Steven Deller
2001-11-11 12:36             ` Jean-Marc Bourguet
2001-11-10 22:07         ` Jeffrey Carter
2001-11-11 17:28           ` Jeffrey Carter
2001-11-10 14:51 ` Ehud Lamm
2001-11-10 16:08   ` Larry Kilgallen
2001-11-10 16:23     ` List container: Insert and Delete Nick Roberts
2001-11-10 17:13       ` Ted Dennison
2001-11-10 21:20         ` Nick Roberts
2001-11-10 22:15           ` Ehud Lamm
2001-11-10 22:48             ` Ted Dennison
2001-11-10 22:40       ` Jeffrey Carter
2001-11-11  4:00         ` Nick Roberts
2001-11-11 17:37           ` Jeffrey Carter
2001-11-11 19:29             ` Steven Deller
2001-11-12  0:20               ` Nick Roberts
2001-11-12  3:48                 ` Steven Deller
2001-11-12 13:54                   ` Nick Roberts
2001-11-12 15:21                     ` Larry Kilgallen
2001-11-13  1:19                       ` Nick Roberts
2001-11-12 17:27                     ` Jeffrey Carter
2001-11-13  1:28                       ` Nick Roberts
2001-11-13  1:37                         ` Darren New
2001-11-13 15:58                         ` John English
2001-11-13 17:53                         ` Pascal Obry
2001-11-12 15:42                   ` Marin David Condic
2001-11-12  5:23                 ` Ted Dennison
2001-11-12 13:04                   ` Nick Roberts
2001-11-12 16:36                     ` Ted Dennison
2001-11-12 17:20                     ` Jeffrey Carter
2001-11-12 18:55                       ` Marin David Condic
2001-11-12 19:56                         ` Larry Kilgallen
2001-11-12 20:36                           ` Marin David Condic
2001-11-12 21:14                           ` Darren New
2001-11-13  7:31                           ` Simon Wright
2001-11-13 21:31                             ` Marin David Condic
2001-11-14  4:43                               ` Nick Roberts
2001-11-13  2:16                         ` Jeffrey Carter
2001-11-13 14:18                           ` Marin David Condic
2001-11-13 15:03                             ` Ted Dennison
2001-11-13 15:28                               ` Marin David Condic
2001-11-13 16:16                               ` Jeffrey Carter
2001-11-13 19:59                                 ` Ted Dennison
2001-11-13 20:18                                   ` Marin David Condic
2001-11-13 21:26                                     ` Ted Dennison
2001-11-13 21:39                                       ` Marin David Condic
2001-11-13 22:16                                         ` Map container (was: List container: Insert and Delete) Ted Dennison
2001-11-14 15:07                                           ` Marin David Condic
2001-11-13 22:22                                   ` List container: Insert and Delete Jeffrey Carter
2001-11-13 17:46                               ` Darren New
2001-11-13 19:25                                 ` Steven Deller
2001-11-13 19:40                                   ` Darren New
2001-11-13 20:53                                     ` Ted Dennison
2001-11-13 20:10                                 ` Ted Dennison
2001-11-13 21:31                                   ` Darren New
2001-11-13 22:37                                     ` Ted Dennison
2001-11-13 22:44                                       ` Ted Dennison
2001-11-13 23:00                                       ` Darren New
2001-11-14 14:31                                         ` Ted Dennison
2001-11-13 14:20                           ` Steven Deller
2001-11-13 15:48                   ` John English
2001-11-13 20:22                     ` Ted Dennison
2001-11-14 12:59                       ` John English
2001-11-14 14:55                         ` Ted Dennison
2001-11-14 15:34                           ` Marin David Condic
2001-11-15 16:35                           ` John English
2001-11-14 16:41                         ` Jeffrey Carter
2001-11-13 20:22                     ` Ehud Lamm
2001-11-13 21:33                       ` Simon Wright
2001-11-14 12:54                       ` John English
2001-11-14 16:43                         ` Ehud Lamm
2001-11-14 18:19                           ` Marin David Condic
2001-11-15  4:29                             ` Jeffrey Carter [this message]
2001-11-15 15:25                               ` List container: Sawdust woman 43 Marin David Condic
2001-11-16  1:59                                 ` Jeffrey Carter
2001-11-15 20:30                             ` List container: Insert and Delete Simon Wright
2001-11-15 17:01                           ` John English
2001-11-19 17:40                             ` Ted Dennison
2001-11-20 10:52                               ` John English
2001-11-13 21:07                     ` Ted Dennison
2001-11-12 17:18                 ` Jeffrey Carter
2001-11-12 17:13               ` Jeffrey Carter
2001-11-11 23:34             ` Nick Roberts
2001-11-12 16:33               ` Jeffrey Carter
2001-11-12 17:28                 ` Ted Dennison
2001-11-13  2:27                   ` Jeffrey Carter
2001-11-13 14:21                     ` Ted Dennison
2001-11-14  4:16                       ` Nick Roberts
2001-11-14 15:03                         ` Ted Dennison
2001-11-13  0:51                 ` Nick Roberts
2001-11-12 16:51               ` Ted Dennison
2001-11-13  0:44                 ` Nick Roberts
2001-11-13 14:18                   ` Ted Dennison
2001-11-14  4:17                     ` Nick Roberts
2001-11-10 16:12   ` List container strawman 1.2 Ted Dennison
2001-11-10 18:49     ` Jean-Marc Bourguet
2001-11-10 19:29       ` Ehud Lamm
2001-11-11 10:46         ` Jean-Marc Bourguet
2001-11-11 13:07           ` Larry Kilgallen
2001-11-10 19:07     ` Jacob Sparre Andersen
2001-11-10 22:53       ` Ted Dennison
2001-11-12 16:45         ` Jacob Sparre Andersen
2001-11-13  0:55           ` Nick Roberts
2001-11-13 15:11             ` Ted Dennison
2001-11-10 22:17     ` Jeffrey Carter
2001-11-11 22:04       ` Simon Wright
2001-11-12 16:53         ` Ted Dennison
2001-11-13  7:25           ` Simon Wright
2001-11-13 22:04             ` Ted Dennison
2001-11-10 17:43   ` Florian Weimer
2001-11-10 16:46 ` Ted Dennison
2001-11-10 18:50   ` Steven Deller
2001-11-12  9:25 ` Martin Dowie
2001-11-12 12:57   ` Nick Roberts
2001-11-12 15:32   ` Marin David Condic
2001-11-12 16:58     ` Martin Dowie
2001-11-12 18:44       ` Marin David Condic
2001-11-13  7:18         ` Simon Wright
2001-11-13 21:26           ` Marin David Condic
2001-11-15 23:53             ` martin.m.dowie
2001-11-12 17:35     ` Ted Dennison
2001-11-12 18:39       ` Martin Dowie
2001-11-12 19:58         ` Ted Dennison
2001-11-12 18:39     ` Steven Deller
2001-11-12 20:05       ` Ted Dennison
2001-11-13 19:12       ` Stephen Leake
2001-11-12 16:37   ` Jeffrey Carter
2001-11-12 18:50     ` Marin David Condic
2001-11-13  1:07       ` Nick Roberts
2001-11-13 15:13         ` Ted Dennison
2001-11-15 23:54           ` martin.m.dowie
2001-11-13 19:10   ` Stephen Leake
     [not found] ` <3BF0247D.4500975E@san.rr.com>
2001-11-12 20:30   ` Ehud Lamm
2001-11-12 21:57   ` Ted Dennison
2001-11-12 22:53     ` Darren New
2001-11-12 22:55       ` Darren New
2001-11-13 15:54         ` Ted Dennison
2001-11-13 19:17           ` Stephen Leake
2001-11-13 22:37           ` Jeffrey Carter
2001-11-13 15:49       ` Ted Dennison
2001-11-13 16:38         ` Martin Dowie
2001-11-13 19:06           ` Ted Dennison
2001-11-13 19:43             ` Marin David Condic
2001-11-13 20:50               ` Ted Dennison
2001-11-13 21:08                 ` Marin David Condic
2001-11-14  4:34                   ` Nick Roberts
2001-11-14 14:58                     ` Marin David Condic
2001-11-13 17:36         ` Darren New
2001-11-14  4:40           ` Nick Roberts
2001-11-13 22:34         ` Jeffrey Carter
2001-11-14 13:39           ` John English
2001-11-14 15:09             ` Ted Dennison
2001-11-14 16:04               ` Jeffrey Carter
2001-11-14 16:36                 ` Ted Dennison
2001-11-15 16:31               ` John English
2001-11-19 17:59                 ` Ted Dennison
2001-11-19 21:08                   ` Stephen Leake
2001-11-20 10:43                   ` John English
2001-11-21 19:40                   ` ramatthews
2001-11-22  3:01                     ` Nick Roberts
2001-11-22  9:28                       ` John English
2001-11-24  3:52                         ` Nick Roberts
2001-11-23  2:21                       ` Ted Dennison
2001-11-24  0:27                         ` John English
2001-11-27 20:04                         ` Marin David Condic
2001-11-28  8:10                           ` Thomas Wolf
2001-11-28 14:29                             ` Marin David Condic
2001-11-28 17:34                               ` Ted Dennison
2001-11-28 18:01                                 ` Marin David Condic
2001-11-28 18:53                                   ` Ted Dennison
2001-11-28 19:08                                     ` Overriding 'Class'Input (was: List container strawman 1.1) Ted Dennison
2001-11-28 19:19                                       ` Ted Dennison
2001-11-28 20:40                                       ` Marin David Condic
2001-11-28 21:21                                         ` Ted Dennison
2001-11-28 21:50                                           ` Marin David Condic
2001-11-29  5:12                                             ` Nick Roberts
2001-11-29 20:04                               ` List container strawman 1.2 Thomas Wolf
2001-11-16  0:01             ` martin.m.dowie
replies disabled

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