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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: A few questions Date: Mon, 16 Nov 2015 21:47:32 +0100 Organization: cbb software GmbH Message-ID: <8hw612c7lfik.1cy0uanjjnpzv$.dlg@40tude.net> References: <5007b311-5d2e-448c-b8c8-fc2e2d88ea5e@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: j6IQVb9uobzjXrpQLDU2rQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28408 Date: 2015-11-16T21:47:32+01:00 List-Id: 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. > 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. Both concepts of iterator and index have fundamental operations to create a new instance referencing some other element (next, previous, sibling, parent, neighbour etc) >>> 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de