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 X-Google-Thread: 103376,55f6e230b02eff2f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!62.111.101.3.MISMATCH!news.germany.com!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Containers - nontrivial element access Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1191275759.184463.238350@n39g2000hsh.googlegroups.com> Date: Tue, 2 Oct 2007 09:23:00 +0200 Message-ID: NNTP-Posting-Date: 02 Oct 2007 09:17:13 CEST NNTP-Posting-Host: 0119ea1b.newsspool2.arcor-online.net X-Trace: DXC=L[hW8Feb33L78PK[oJ2ng@A9EHlD;3YcB4Fo<]lROoRA<`=YMgDjhgBE6Adb_kBffB[6LHn;2LCVN7enW;^6ZC`DIXm65S@:3>OT\m22O:e0QM X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:2245 Date: 2007-10-02T09:17:13+02:00 List-Id: On Mon, 01 Oct 2007 14:55:59 -0700, Maciej Sobczak wrote: > I was thinking recently about what is wrong with the containers > interface. ;-) You compare two paradigms functional (closure, to access an element) and non-functional (explicit element access). They both are complete, in some sense. Yes functional is often counterintuitive, and I don't like it either. > What would you suggest as the Ada solution for this problem? I would use handles to elements and containers of handles. > The Update_Element procedure with its access to the user-provided > modifying procedure requires to pass data "under the table" (like with > a separate variable declared aside the modifying procedure) - and > seems to be just clunky. Is this the only possibility? So one could add access closures to "a pair of elements" to containers: Update_Two_Elements, (and then a triple, and etc (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de