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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,70414f56d810c10c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.27.231 with SMTP id w7mr9775840pbg.7.1316818262939; Fri, 23 Sep 2011 15:51:02 -0700 (PDT) MIME-Version: 1.0 Path: lh7ni3513pbb.0!nntp.google.com!news1.google.com!goblin3!goblin1!goblin.stu.neva.ru!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Fri, 23 Sep 2011 17:50:57 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <01a1374f-59ab-40be-9e39-0640cb2a513d@n35g2000yqf.googlegroups.com> <1fp2o673mu9az$.d9loz1zbcl0d.dlg@40tude.net> <14tiipigyejtc$.hyp7e82egqwq$.dlg@40tude.net> <34d856bd-19a3-4bbf-b9d8-c0f100000ef4@k7g2000vbd.googlegroups.com> <1tpl2pc36ptr4$.txv4v3wmkjlm.dlg@40tude.net> <1malv6h6q31j3.uz9ws5j0glnm.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1316818261 30003 69.95.181.76 (23 Sep 2011 22:51:01 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 23 Sep 2011 22:51:01 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-RFC2646: Format=Flowed; Original Xref: news1.google.com comp.lang.ada:18107 Date: 2011-09-23T17:50:57-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:fsmyepvncyb2$.2ik4vw3vu74h.dlg@40tude.net... ... >> So you are blaming iterators for having badly designed generic >> container interface in the first place. Not convincing. > > There are more comfortable and safe interfaces than iterators, I want them > available first. I want the language supporting implementation of such > interfaces rather than mounting kludges on kludges like accessors, limited > returns etc. You seem to want to totally avoid the purpose of containers, which is to eliminate unsafe memory management and pointer usage. The whole point of accessors and the like is to provide SAFE referential access to container elements (as well as anything else). Ada access types or anything like them can never be safe, so we need an abstraction to layer on top to provide that safety. The problem that comes about the accessors is that most ways to provide safe referential access don't really work -- they just push the problem somewhere else (moving the access type to a function result, for instance). The win with the accessors in Ada 2012 is that they actually succeed in making the result safe (in the absence of unchecked programming, of course). There is no other way to do that using Ada semantics - at least that we could find (see the many other attempts as this in the Ada 2005 AIs -- several are documented in the alternatives to AI05-0142). Your interface ideas probably would make sense in a totally new language, but would be totally unimplementable in Ada (we'd have to get rid of at least discriminants, subtypes, general access types, and generics to have any chance to make them work). Please give them a rest and return to the real world. Randy.