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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.254.74 with SMTP id ag10mr50946673pad.24.1448740481786; Sat, 28 Nov 2015 11:54:41 -0800 (PST) X-Received: by 10.182.125.3 with SMTP id mm3mr450270obb.13.1448740481734; Sat, 28 Nov 2015 11:54:41 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!mv3no5019603igc.0!news-out.google.com!l1ni319igd.0!nntp.google.com!mv3no6427177igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 28 Nov 2015 11:54:41 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=68.145.219.148; posting-account=lzqe5AoAAADHhp_gregSufVhvwu22fBS NNTP-Posting-Host: 68.145.219.148 References: <0c524381-442a-49cc-9d72-27a654320153@googlegroups.com> <073bed9a-32f2-4045-93ec-064322edf883@googlegroups.com> <834c6afa-870e-4921-a1f1-4fe2b061811a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <247bcf0b-af39-4e78-abe9-aa4810042f98@googlegroups.com> Subject: Re: Two approaches of iterators for the key-value pairs From: Brad Moore Injection-Date: Sat, 28 Nov 2015 19:54:41 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28580 Date: 2015-11-28T11:54:41-08:00 List-Id: On Saturday, November 28, 2015 at 1:58:47 AM UTC-7, Simon Wright wrote: > Brad Moore writes: >=20 > > My sense is that if you dont need a container as part of the > > abstraction, then perhaps it's better to just provide an Iterator > > type. All the existing containers already were containers, so for > > those it made sense to make them Iterable containers. Ada.Directories > > and Ada.Environment_Variables do not currently have Containers > > associated with them, so perhaps an argument can be made that they > > should be Iterators, rather than concoct a Container type so that > > Iterable container syntax can be used. >=20 > I don't see it as concocting a Container type; it's an Iterable > type. Containers happen to be Iterable. >=20 > It's unfortunate (but understandable!) that 4.1.6 and 5.5.1, .2 use > container-related language. I suspect my comment was misunderstood here. My comment was about having to create an extra declaration in the packages = Ada.Directories and Ada.Environment_Variables to define a container type. For Directories, I had a Directory_Listing type, and for Environment_Variab= les, the container type could be called Environment. If we went with the It= erator approach instead of the container approach, this wouldn't be needed.= In both cases, an Iterator type would be needed. Having to create a contai= ner type isn't unreasonable, because one can think of a Directory_Listing a= s being a container of file names, or an Environment as being a container o= f Environment variables. However, these extra declarations could be viewed = as extra "clutter" to add to the standard packages. If we went with the Ite= rator approach, there would be less clutter, yet achieve basically the same= objective. Brad