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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Non_Primitive Operations and Object.Operation Resolution Date: Fri, 22 Apr 2016 17:37:04 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 23 Apr 2016 00:33:46 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="48b46be33beed75863f69afa437f956b"; logging-data="21949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ySqLH/Bs44shiEP9IGFeSpDVXfNBsvBg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: Cancel-Lock: sha1:/oMGcmMvj+f3/X93Ghvl7trit14= Xref: news.eternal-september.org comp.lang.ada:30252 Date: 2016-04-22T17:37:04-07:00 List-Id: On 04/22/2016 03:24 PM, Randy Brukardt wrote: > > My view is that anytime you have more than one visible (note: not > necessarily *directly* visible) entity with the same name and same profile, > but has different semantics, you have unnecessarily tricky code, regardless > of the legality of that code. A reader of the code could very well refer to > the wrong declaration (programmers are not great at figuring out the nuances > of Ada visibility rules), and that could lead to problems during program > maintance (especially if that maintenance is done by someone other than the > original author). As such, I'd suggest that the routine in the body be named > something like Safe_Element just to reduce this potential confusion. (I know > *I* could very well use the wrong routine in debugging this package.) It seems clear to me, but I guess I'm weird. Generic iterators (which I've been using since Ada 83 was the current version) seem clear to me, but I recall reading somewhere that some ARG members found them confusing. > Still, legal Ada code ought to compile. even when it isn't a good idea. :-) Absolutely. -- Jeff Carter "Go and boil your bottoms." Monty Python & the Holy Grail 01