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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Functions vs constants Date: Wed, 23 Jul 2014 14:37:51 +0200 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 23 Jul 2014 12:37:52 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="12022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wrmi80xvP3YlMSu3/kvTPtKcodaUlIlU=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:5SMFnnpQ6dNcFnEDDPzrnfY6udw= Xref: news.eternal-september.org comp.lang.ada:21152 Date: 2014-07-23T14:37:51+02:00 List-Id: On 23.07.14 00:07, Randy Brukardt wrote: > with P, Q; use P, Q; > procedure R is > begin > if Error then -- (1) > raise Error; -- (2) > end if; > end R; > > both (1) and (2) are illegal today. But there's no good reason for that; the > profiles (imagining an extended idea of profile to include objects and > exceptions) are different and there can be no more confusion between them > than between overloaded enumeration literals. Well, this text gives the reader a lucid hint at what the homonyms might mean! Sounds like more context dependency as we have some already, don't we. Good grief. This over-overloading, rightfully frowned upon by SPARK (and not just by SPARK), I think, plays into the hands of those programmers who like to write less, be secretive, and brag about some unproductive linguistic cleverness. Why force inference on readers of Ada programs? The result is so similar to obfuscated source text. Javascript compilers employ this very technique, i.e. they re-use names like `a' as often as lexical bindings will permit. IMHO, no single name should denote different objects appearing in one piece of "discourse" (block). Prefixes are good! JOE - “Hey Jack!” JACK_1 - “Yes?” JACK_2 - “Yes?” JOE - “Push that jack over here!” JACK_1 - “What?” JACK_2 - “What has he done?" JOE - “No, the jack on wheels.” JACK_1 - “None of us has wheel shoes.” JACK_2 - “No, he means the flag.” ... As you can see, homonyms make things appear silly (on at least two accounts). But it doesn't stop here, since the internet of things will, I'm certain, make jacks capable of reacting to voice commands...