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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 18 Aug 2010 14:51:28 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID: <4c6bd750$0$6893$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 18 Aug 2010 14:51:28 CEST NNTP-Posting-Host: f9e5af47.newsspool2.arcor-online.net X-Trace: DXC==@2en\^E==6i6K;>iZ]763A9EHlD;3Yc24Fo<]lROoR18kF:Lh>_cHTX3j=XdOhE5KTfl3 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:13482 Date: 2010-08-18T14:51:28+02:00 List-Id: On 18.08.10 13:59, Natasha Kerensikova wrote: > Then I don't really understand the point of having both Vectors and > Doubly_Linked_Lists. The interface of Vectors is a strict superset of > the interface of Doubly_Linked_Lists, and the only difference in > complexity (which is advice anyway, so non-guaranteed) is on Prepend. The difference in complexity, in both time and space, is likely present in other operations. The Implementation Advice in the LRM stipulates that Vector is likely an array, internally. It is in GNAT's Vectors, last time I checked. In addition to Cursor based operations, Vectors have Index based operations, like arrays. Lists don't have them; I trust that Vectors have the lowest overhead for directly accessing specific elements of any container, e.g. "the elements at index 5 and 5 plus offset". If you wanted the same for a list then this could mean linear traversal. (At least when there are no auxiliary tables internal to the list implementation, which might in turn be implemented using a vector kind of thing, exposing a need for a vector abstraction...) Georg