comp.lang.ada
 help / color / mirror / Atom feed
From: Brad Moore <bmoore.ada@gmail.com>
Subject: Re: Two approaches of iterators for the key-value pairs
Date: Sat, 28 Nov 2015 11:54:41 -0800 (PST)
Date: 2015-11-28T11:54:41-08:00	[thread overview]
Message-ID: <247bcf0b-af39-4e78-abe9-aa4810042f98@googlegroups.com> (raw)
In-Reply-To: <ly610m33ga.fsf@pushface.org>

On Saturday, November 28, 2015 at 1:58:47 AM UTC-7, Simon Wright wrote:
> Brad Moore <bmoore.ada@gmail.com> writes:
> 
> > 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.
> 
> I don't see it as concocting a Container type; it's an Iterable
> type. Containers happen to be Iterable.
> 
> 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_Variables, the container type could be called Environment. If we went with the Iterator approach instead of the container approach, this wouldn't be needed. In both cases, an Iterator type would be needed. Having to create a container type isn't unreasonable, because one can think of a Directory_Listing as being a container of file names, or an Environment as being a container of Environment variables. However, these extra declarations could be viewed as extra "clutter" to add to the standard packages. If we went with the Iterator approach, there would be less clutter, yet achieve basically the same objective.

Brad

  reply	other threads:[~2015-11-28 19:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 15:25 Two approaches of iterators for the key-value pairs ytomino
2015-11-27 16:30 ` Dmitry A. Kazakov
2015-11-27 18:08   ` ytomino
2015-11-27 20:50     ` Dmitry A. Kazakov
2015-11-27 22:52     ` bj.mooremr
2015-11-27 17:00 ` Pascal Obry
2015-11-27 18:25   ` ytomino
2015-11-27 17:43 ` Brad Moore
2015-11-27 19:38   ` ytomino
2015-11-27 19:46     ` ytomino
2015-11-27 23:11     ` Brad Moore
2015-11-28  8:58       ` Simon Wright
2015-11-28 19:54         ` Brad Moore [this message]
2015-11-28 23:34           ` Simon Wright
2015-11-29 21:17             ` Bob Duff
2015-11-29 16:17         ` Simon Wright
2015-11-29 17:55       ` ytomino
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox