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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Two approaches of iterators for the key-value pairs Date: Sat, 28 Nov 2015 08:58:45 +0000 Organization: A noiseless patient Spider Message-ID: References: <0c524381-442a-49cc-9d72-27a654320153@googlegroups.com> <073bed9a-32f2-4045-93ec-064322edf883@googlegroups.com> <834c6afa-870e-4921-a1f1-4fe2b061811a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="fa1ef3748c46c80a9a627d7896b0bfd1"; logging-data="11690"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CUNNMGKrB2ihmiw+z7Ted1ITI++8dpJo=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:kG/oC9T+JIFbHSyvY2waimiIjZc= sha1:pAFkw7PVkhcsnSOazz1jQfOJypo= Xref: news.eternal-september.org comp.lang.ada:28577 Date: 2015-11-28T08:58:45+00:00 List-Id: Brad Moore 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.