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!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Latest suggestion for 202x Date: Mon, 24 Jun 2019 15:06:23 +0300 Organization: Tidorum Ltd Message-ID: References: <86h88obeu0.fsf@gaheris.avalon.lan> <39e749cd-de5c-44fa-b8ec-50d36f3bd52c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net drwZMbPbby3ZwKUAlx4F0QiMfhYg3Cvzld/f+nAkpvMEvbkcv8 Cancel-Lock: sha1:QGbQJm3kZyyylceRf0M1Br5AVGI= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:56731 Date: 2019-06-24T15:06:23+03:00 List-Id: On 19-06-24 14:12 , Stefan.Lucks@uni-weimar.de wrote: >> The principle for any decent language is that if two identifiers mean >> the same thing in the brain of the reader, then they must correspond >> to the same entity. And the meaning of a word is not changed by casing. > > Do you really think so? > > I think, the capical 'I' is very different from i=sqrt(-1). ;-) > > To be honest, I agreee that Ada should not adapt the concept of many > other case-sensitive languages that capitalization (such as changing > between 'I' and 'i') gives you two different identifiers, to be used > interchangeably. > > On the other hand, I would prefer the compiler to require a consistent > casing. E.g., if you define an identifier "Ada", you are not allowed to > spell the same identifier as "ADA", "ada", "aDa", ... anywhere else. GNAT has the option -gnatyr, which is described as follows: "r (check references): If the letter r appears in the string after -gnaty then all identifier references must be cased in the same way as the corresponding declaration. No specific casing style is imposed on identifiers. The only requirement is for consistency of references with declarations." I agree that this consistency is a good rule in general, but sometimes it results in strange-looking code when a program with a certain identifier-casing convention (say, Title_Case) uses a library with another convention (say, UPPER_CASE), leading to subprogram calls with different conventions. Oh well, perhaps Title_Case will be the law someday... > Or consider > > procedure P(Value: Integer) is ... > ... > > declare > i: Integer := 0; > begin > declare > I: Integer := 1; > begin > P(i); -- DOES call P(1) in Ada, since Ada is > -- not case-sensitive > -- WOULD call P(0) in most other modern languages, > -- which usually have case-sensitive identifiers > -- SHOULD be treated as an error, because "i" and "I" > -- are *different* identifiers, nevertheless "i" > -- has been hidden by "I". > end; > end; GNAT also has "-gnatwh", which would warn about "I" hiding "i". -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .