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,55f6e230b02eff2f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 04 Oct 2007 15:01:53 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Containers - nontrivial element access References: <1191275759.184463.238350@n39g2000hsh.googlegroups.com> <1191343071.685478.146710@19g2000hsx.googlegroups.com> <1191358939.031798.177670@k79g2000hse.googlegroups.com> <1191363628.908691.313970@k79g2000hse.googlegroups.com> <1191441598.702440.314410@22g2000hsm.googlegroups.com> In-Reply-To: <1191441598.702440.314410@22g2000hsm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4704e442$0$30370$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 04 Oct 2007 15:01:54 CEST NNTP-Posting-Host: 98e9c745.newsspool4.arcor-online.net X-Trace: DXC=GcQ7F_i7@;X@@RW1FjIB5S4IUKUR_5YN[W Maciej Sobczak wrote: > Your solution requires some dose of liberal thinking, which I'm not > easily willing to accept in the language that boasts high-integrity > mindset. ;-) To me, nesting procedures seems a still easier to understand than having to understand what magic (yes!) f(foo[x].bar, foo[y].bar) will do behind the scenes. You saw that is was necessary to explain swap() in the first place because it isn't obvious what it does, and how. When I just see swap(foo[x].bar, foo[y].bar); copy(foo[x].bar, foo[y].bar); will the names let me guess (correctly!) that the two functions supposedly employ different mechanism and achieve different effects, if so? BTW, the second line shows how this isn't explicitly stating things at all: in which direction would copy() be working? You said that an Ada solution will pass things below the table (nesting procedures yielding less immediate visibility (uplevel references)). IMHO, swap(a[b].c, d[e].c) is passing things under the carpet below the table. Why not strive for something like swap_salary(c1, c2); where c1, c2: Cursor; As these all are implementation level thoughts, inviting proper information hiding in place of hinting to mechanisms in function names (swap), IMHO.