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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,70414f56d810c10c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!eb1g2000vbb.googlegroups.com!not-for-mail From: ytomino Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Tue, 20 Sep 2011 12:50:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: <68e40dd6-d32d-4a41-ae46-997b903a6016@eb1g2000vbb.googlegroups.com> References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <708a1202-d480-451b-9b55-00b31ad9c452@w28g2000yqw.googlegroups.com> <1kx7ltnsal62q.195k449mr947t.dlg@40tude.net> <4e7840c1$0$7608$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 118.8.62.179 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1316548223 17350 127.0.0.1 (20 Sep 2011 19:50:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 20 Sep 2011 19:50:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: eb1g2000vbb.googlegroups.com; posting-host=118.8.62.179; posting-account=Mi71UQoAAACnFhXo1NVxPlurinchtkIj User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKUARELSC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Safari/535.1,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:21997 Date: 2011-09-20T12:50:23-07:00 List-Id: I'm glad you wrote body of Generic_Count. > I think, though, that Query_Element will obviate the need for the > wrapping pointer types; not sure I understand why you want them. To be honest, I think so, too. Query_Interface is enough. ^_^; I'm trying to use new inerface. And Constant_Reference makes code a little easy. You do not need to divide Search and Use_CRefT differ from Query_Interface. procedure Search (Position : Cursor) is begin if Constant_Reference (C, Position).Element.all = Value then Sum := Sum + 1; end if; end Search; > Is this influenced by a 1:1 transport of C++ STL algorithms? > I wonder whether the C++ STL would be different if C++ could use > proper nesting or in case it had drawn more attention to function > objects. It will be wonderful supposing STL algorithms is transplantable. But I do not feel necessity. I just want to make my generic subprograms (it is not so general as STL algorithms) independent of a container for conforming to the first purpose of abstraction of STL is separation of a container and an algorithm, but I do NOT want to make a perfect copy of C++. Of course there is some differences. Iterator of STL mimics pointer, but Cursor of Ada.Containers mimics index. C++0x has lambda, but Ada has downward closure, etc. I would like to respect functions in Ada.