comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Standard Queue status
Date: Thu, 29 Nov 2001 10:23:29 -0500
Date: 2001-11-29T15:23:31+00:00	[thread overview]
Message-ID: <9u5jtj$r1d$1@nh.pace.co.uk> (raw)
In-Reply-To: IPrN7.42250$xS6.70888@www.newsranger.com

What about this:

package Unbounded_Arrays is
    type Array_Type is private ; --etc...
end Unbounded_Arrays ;

package Unbounded_Lists is
    type List_Type is private ; -- etc...
end Unbounded_Lists ;

with Unbounded_Arrays ;
package Unbounded_Lists.Lesser_Used_Operations is
    function To_Unbounded_List (
        Item : in Unbounded_Arrays.Array_Type) return List_Type ;
end Unbounded_Lists.Less_Used_Operations ;

This has a variety of advantages. The package Unbounded_Lists supplies just
the basic plain-vanilla operations one needs for a list, so it isn't a
burden for the simple cases. There might be a whole variety of other similar
conversions one might want to perform - such as changing Maps into Lists or
Trees into Lists - we don't yet know what all of the possible abstract types
are that we might want to build or what sort of conversions would be
desirable. We are also likely to discover a large variety of
lesser-used-yet-still-useful operations that we might want to bundle up
somehwere and have available - a child package seems like the proper place
for all this potential baggage.

Want a simple list? Use Unbounded_Lists. Want to perform conversions between
all of our standard components? Grab Unbounded_Lists.Conversions and go
through a few complicated gyrations to get it to work. Want to compute
statistics on your list data? Bring in Unbounded_Lists.Statistics. Want some
clever-but-obscure list operations? Bring in Unbounded_Lists.Tenebrous.
Defering to child packages lets us initially concentrate on the really
fundamental stuff first & leave the rest for later.

I have not given much thought as to how to deal with the instantiations - it
does look like a kind of double-inheritance. However, we could probably come
up with something that stalled the operations off to a child package.
(Unbounded arrays become a descendent of unbounded lists? Gen-Spec
relationship?)

MDC

--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Ted Dennison" <dennison@telepath.com> wrote in message
news:IPrN7.42250$xS6.70888@www.newsranger.com...
>
> The issue is wheather to provide for converting between them and lists.
Note
> that Ada.Strings.Unbounded does this exact same thing for Strings and
> Unbounded_String's. The only real difference is that the String type
already
> exists, whereas the unbounded array type would have to be declared in the
> package.
>






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

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-27  1:19 Queue steve
2001-11-27  2:07 ` Queue Larry Kilgallen
2001-11-27 19:30   ` Queue Ted Dennison
2001-11-27 19:45     ` Queue Marin David Condic
2001-11-27 20:29       ` Queue Matthew Heaney
2001-11-27 20:55         ` Queue Marin David Condic
2001-11-27 21:20           ` Queue Ehud Lamm
2001-11-27 22:13             ` Queue Marin David Condic
2001-11-27 22:35               ` Queue Ehud Lamm
2001-11-28 14:53                 ` Queue Marin David Condic
2001-11-28 16:40                   ` Standard Library, Again (was: Re: Queue) Jeffrey Carter
2001-11-28 18:37           ` Standard Queue status Ted Dennison
2001-11-28 21:02             ` Marin David Condic
2001-11-28 21:40               ` Ehud Lamm
2001-11-29 14:42                 ` Ted Dennison
2001-11-29 15:23                   ` Marin David Condic [this message]
2001-11-29 17:58                     ` Ted Dennison
2001-11-29  7:23             ` Mats Karlssohn
2001-11-29 14:55               ` Ted Dennison
2001-11-29 15:58               ` Jeffrey Carter
2001-11-29 16:27                 ` Marin David Condic
2001-11-29 18:10                 ` Ted Dennison
2001-11-30  2:00                   ` Jeffrey Carter
2001-11-30 15:07                     ` Ted Dennison
2001-11-30 20:19                 ` Mark Lundquist
2001-11-29 13:47             ` Stephen Leake
2001-11-29 15:53               ` Marin David Condic
2001-11-29 18:10                 ` Stephen Leake
2001-11-29 18:58                   ` Marin David Condic
2001-11-29 18:21                 ` Ted Dennison
2001-11-29 19:12                   ` Marin David Condic
2001-11-29 20:25                     ` Ted Dennison
2001-11-29 22:49                       ` Marin David Condic
2001-11-30 15:15                         ` Ted Dennison
2001-11-30 15:32                           ` Marin David Condic
2001-11-30 19:49                             ` tmoran
2001-11-29 18:29               ` Stephen Leake
2001-11-29 19:27                 ` Marin David Condic
2001-11-29 20:35                   ` Ted Dennison
2001-11-29 22:54                     ` Marin David Condic
2001-11-30  1:51                       ` Jeffrey Carter
2001-11-29 18:37               ` Ted Dennison
2001-12-04 19:48                 ` Stephen Leake
2001-12-04 20:27                   ` Ted Dennison
2001-11-29 22:29               ` Jeffrey Carter
2001-11-30  2:19                 ` Nick Roberts
2001-12-04 19:51                   ` Stephen Leake
2001-11-30 15:19                 ` Ted Dennison
2001-11-30 12:40               ` Simon Wright
2001-11-27 21:38         ` Queue Brian Rogoff
2001-11-28  8:07           ` Queue Mats Karlssohn
2001-11-30  4:49             ` Queue Brian Rogoff
2001-11-30 15:30               ` Queue Ted Dennison
2001-11-30 21:02                 ` Queue Ehud Lamm
2001-11-30 21:07               ` Queue Ehud Lamm
2001-11-28  8:28           ` Queue Thomas Wolf
2001-11-28 17:27           ` Queue Ted Dennison
2001-11-30 22:11             ` Queue Ehud Lamm
2001-11-28  8:01         ` Queue Mats Karlssohn
2001-11-28  7:48       ` Queue Mats Karlssohn
2001-11-28 15:39         ` Queue Marin David Condic
2001-11-29  7:35           ` Queue Mats Karlssohn
replies disabled

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