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 10:16:52 +0300 Organization: Tidorum Ltd Message-ID: References: <86h88obeu0.fsf@gaheris.avalon.lan> <39e749cd-de5c-44fa-b8ec-50d36f3bd52c@googlegroups.com> <87imsv4k3z.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net iUX08tW/tQQZeL0ejSXsoQwlcT27r6Gd4FUVExlqL0OBEiPr1U Cancel-Lock: sha1:nLxosTeMjKS7V644jWGyasOiwjI= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <87imsv4k3z.fsf@nightsong.com> Xref: reader01.eternal-september.org comp.lang.ada:56728 Date: 2019-06-24T10:16:52+03:00 List-Id: On 19-06-24 08:40 , Paul Rubin wrote: > "J-P. Rosen" writes: >> Case sensitivity brings nothing but confusion. 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. Yes... most of the time. I recall, as a young programmer several decades ago, being stumped for an embarrassingly long time by a compilation error from the Burroughs Algol compiler, which would not accept the code real IF; ... if IF > limit then ... In a case-insensitive language, of course "IF" is just another form of the reserved word "if". But my brain insisted that "IF" is an identifier that is an acronym / abbreviation for "Intermediate_Frequency"... even when "if" and "IF" were adjacent as above! (That was in the main-frame punch-card ages, when one did not want to use long identifiers because of (a) the 80-column (or 72-column) limit, and (b) the high risk of spelling the identifier incorrectly and having to punch a new card, after waiting an hour or so for the compiler's snide error messages.) > I don't find this in Haskell. The names of types and of data > constructors begin with upper-case letters, and the names of ordinary > variables begin with lower-case letters. So you could have > > string = "hello" > > and that is separate from the type String. That might not be great > style but the language lets you tell the two apart. Formally true, and usually harmless in today's programming styles where identifiers are usually longish words. Ada's case-insensitivity (which I do prefer, in spite of my anecdote above) was, I believe, meant to prevent errors such as having two variables called respectively "x" and "X" and confusing between them. Even if "X" is a type identifier and "x" a variable name, there could be confusion between, say, x'Size and X'Size, which look very similar but can have different values. That said, I do find it a little irksome that Ada's rules force one to invent different, case-insensitive names for types on the one hand, and variables on the other. This leads to conventions such as adding "_T" to all type names, which seem ugly and cumbersome at first. But I don't have any suggestions for a better solution. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .