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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1fa85f3df5841ae1,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news2.google.com!proxad.net!usenet-fr.net!news.enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Duncan Sands Newsgroups: comp.lang.ada Subject: Ada.Containers.Vectors - querying multiple elements Date: Tue, 26 Apr 2005 13:43:52 +0200 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1114515866 26166 212.85.156.195 (26 Apr 2005 11:44:26 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 26 Apr 2005 11:44:26 +0000 (UTC) Cc: users@charles.tigris.org To: comp.lang.ada@ada-france.org Return-Path: X-Mailer: Evolution 2.2.1.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:10714 Date: 2005-04-26T13:43:52+02:00 I've been playing around with Ada.Containers.Vectors (part of Ada 2005, see http://charles.tigris.org/; look for AI-302) and noticed that there's no way to view or operate on a "slice" of a vector. There's a routine procedure Query_Element (Container : in Vector; Index : in Index_Type; Process : not null access procedure (Element : in Element_Type)); for looking at one element; I'd like something like this: procedure Query_Elements (Container : in Vector; First_Index : in Index_Type; Last_Index : in Extended_Index; Process : not null access procedure (Elements : in Element_Array)); where Element_Array would be: type Element_Array is array (Index_Type range <>) of Element_Type; Is there any reason no such routine exists? It would be good to have for both efficiency reasons and simple implementation of certain classes of algorithms. In my case I have a "divide and conquer" recursive algorithm which while it can be written using the current package, would be simpler to write if something like Query_Elements existed. All the best, Duncan.