From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3736685ef876ab2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w34g2000hsg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers Date: Mon, 19 Nov 2007 05:44:02 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1195082906.420079.195000@d55g2000hsg.googlegroups.com> <1s27rv0gt4ujj$.3e2k326rp54d.dlg@40tude.net> <60e46dc9-d8ca-4f47-9e8a-f90a7d45e752@w28g2000hsf.googlegroups.com> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1195479843 9288 127.0.0.1 (19 Nov 2007 13:44:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 Nov 2007 13:44:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w34g2000hsg.googlegroups.com; posting-host=137.138.37.241; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20071019 Red Hat/1.5.0.12-0.7.el4 Firefox/1.5.0.12 pango-text,gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18505 Date: 2007-11-19T05:44:02-08:00 List-Id: On 19 Lis, 03:53, Matthew Heaney wrote: > The container library was directly influenced by the container-part of the STL. And I will repeat that I don't see much influence there. It is impossible to come up with infinite number of significantly different container libraries, so in practice there will be similarities between any two, even if chosen randomly. Can you convince me that Ada.Containers is closer to STL than to Java containers (for example)? If not, then why it is repeated so often that Ada.Containers were influenced by STL? Do you by any chance find something in C++ that is worth imitating? :-) I don't claim that the designers of Ada.Containers didn't have STL in mind when taking some decisions, but the essence [*] of STL just didn't get there. [*] I agree that the exact meaning of "essence" here can be subjective. > > In paricular, I miss the ability to work with iterators *alone*. > > You mean algorithms? As well. > Ada has other mechanisms, such as nested procedures and > downward closures, and the container library was designed to use the Ada > mechanisms. So how can I use these mechanisms to partition the sequence? How can I move the top 10 (for the given comparator) elements to the beginning? How can I sort the first 10 elements of the sequence, without wasting time on sorting the remaining billion? How can I use these mechanisms to make iterator adaptors? Consider a filtering iterator that automatically skips unwanted (for the given predicate) elements. Consider a virtual iterator that does not have *any* container behind, but can serve as a sequence generator. And so on. I know that I can achieve all these in Ada (after spending some weeks), but the solution is so far from the spirit of STL that talking about influence is a bit overstated. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com