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,1fa85f3df5841ae1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Ada.Containers.Vectors - querying multiple elements Date: 26 Apr 2005 08:44:33 -0700 Organization: http://groups.google.com Message-ID: <1114530273.185327.319710@z14g2000cwz.googlegroups.com> References: <426e4c2b$0$7515$9b4e6d93@newsread2.arcor-online.net> NNTP-Posting-Host: 66.162.65.162 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1114530277 21682 127.0.0.1 (26 Apr 2005 15:44:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 Apr 2005 15:44:37 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=66.162.65.162; posting-account=Zl1UPAwAAADEsUSm1PMMiDjihtBlZUi_ Xref: g2news1.google.com comp.lang.ada:10720 Date: 2005-04-26T08:44:33-07:00 List-Id: Duncan Sands wrote: > > (1) efficiency - suppose (for example) I want to transmit the contents > of my vector down a socket. You're not grokking the Ada95 way of doing things. Use the stream operations for that. All containers (indeed, all non-limited types in the predefined language environment) support streaming. Your socket abstraction should have a selector function to return a reference to a stream, so you can say: declare S : Socket; V : Vector; begin ... Vector'Write (Stream (S), V); end; > (2) reuse of legacy code - I don't know about you, but I've a lot of > legacy code around that takes an array as a parameter... A vector container isn't necessarily implemented as an array, so there are no benefits to having array-based operations.