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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: A few questions Date: Tue, 17 Nov 2015 15:30:28 -0600 Organization: JSA Research & Innovation Message-ID: References: <5007b311-5d2e-448c-b8c8-fc2e2d88ea5e@googlegroups.com> <8hw612c7lfik.1cy0uanjjnpzv$.dlg@40tude.net> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1447795830 11078 24.196.82.226 (17 Nov 2015 21:30:30 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 17 Nov 2015 21:30:30 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:28424 Date: 2015-11-17T15:30:28-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:8hw612c7lfik.1cy0uanjjnpzv$.dlg@40tude.net... > On Mon, 16 Nov 2015 13:13:05 -0600, Randy Brukardt wrote: > >> You're speaking nonsense. The element is part of the container, and the >> only >> way to access it is from the container. > > I think you are confusing indices with iterators. The very concept of the > iterator is accessing elements without the container as opposed to the > index. That's surely not my idea of an iterator. And it doesn't work for Ada in any case, as that would allow altering elements of constant containers (we prevent that in the containers library by requiring an "in out" container parameter in all cases where modifications are allowed). >> You can't create a reference to an >> element of a container without having the container. But your proposed >> interface does not have the container anywhere. How does the reference >> get >> created??? > > From the old reference of course. Iterators are pointers. Nonsense. > Both concepts of > iterator and index have fundamental operations to create a new instance > referencing some other element (next, previous, sibling, parent, neighbour > etc) The C++ containers mix up the ideas of iterators and cursors (they're essentially the same thing there). By your description, you want them to be the same -- but in that case, just use the cursors and be done with it. You will sacrifice safety and ease-of-use to do so, but whatever. >>>> Making a language "more expressive" is code for "easier to write", >>>> which >>>> never was a goal of Ada. >>> >>> That's one of the issue here. The goal for Ada, as I understand it, has >>> always >>> been to be "easier to read". There is no reason why "easier to write" >>> should >>> be in opposition to that goal. >> >> "Easier to write" almost always is in opposition, because it means using >> shorthands that cannot easily be deciphered by a human. The "for E of >> Container loop" is certainly in that category, we only allow it because >> no >> one other than implementers need to understand how it works in detail. >> The >> way one expects it to work is in fact how it works when read - but if you >> need to understand the details, it's a disaster. > > A disaster is when nobody can understand the details. The concept of > iteration is simple, so an implementation of its syntax sugar (nothing > more > than sugar) must be easily readable and writeable, since all work is > already done in the container. Well, that's what we did, but you don't seem to be able to see it. Can't help with that... Randy.