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: 103376,55f6e230b02eff2f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!22g2000hsm.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Containers - nontrivial element access Date: Wed, 03 Oct 2007 12:59:58 -0700 Organization: http://groups.google.com Message-ID: <1191441598.702440.314410@22g2000hsm.googlegroups.com> 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> NNTP-Posting-Host: 85.3.110.87 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1191441598 5636 127.0.0.1 (3 Oct 2007 19:59:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 3 Oct 2007 19:59:58 +0000 (UTC) In-Reply-To: <1191363628.908691.313970@k79g2000hse.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 22g2000hsm.googlegroups.com; posting-host=85.3.110.87; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2277 Date: 2007-10-03T12:59:58-07:00 List-Id: On 3 Pa , 00:20, Matthew Heaney wrote: > > BTW - above, PX plays the role of that additional variable that is > > sneaked around to the second procedure. Here it just pretends to not > > exist by taking the form of a parameter in the outer procedure. I > > don't think there is a reasonable way to avoid it. > > The number of "additional variables" is exactly the same in both the C+ > + and Ada examples. The only difference is how the variables are > named. No. The difference is in whether the subprogram's protocol is fully described by its signature. Your nested procedures have the signature that gives provisions for one parameter only. The other one is sneaked in bypassing the signature (so that the protocol is wider than the signature and this is not explicit). This hinders analysis. I can even think about coding standards that explicitly forbid subprograms that use anything other than what is in their signature (except for the main subprogram, which might need to access some library-level objects). Your solution requires some dose of liberal thinking, which I'm not easily willing to accept in the language that boasts high-integrity mindset. ;-) -- Maciej Sobczak * www.msobczak.com * www.inspirel.com