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 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a50a3c40267219cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-22 23:07:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Why not combine Ada and C++? Date: Mon, 22 Oct 2001 23:11:09 -0700 Organization: AdaWorks Software Engineering Message-ID: <3BD509FD.4DB782A@adaworks.com> References: <3105e154.0110150021.32ff5426@posting.google.com> <9qeg5r$266$1@trog.dera.gov.uk> <3BCB3D5E.8FCE9C49@sparc01.ftw.rsc.raytheon.com> <3BD503FA.6000700@mail.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cd.53 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 23 Oct 2001 06:07:12 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:15062 Date: 2001-10-23T06:07:12+00:00 List-Id: Hyman Rosen wrote: > And as far as causing confusion, Ada already allows the same name to > mean multiple things. Quoting from Barnes, > > type Colour is (Red, Amber, Green); > type Stone is (Amber, Beryl, Quartz); > > So when you see Amber in the code, you don't instantly know what it > refers to - you have to examine the context. Reading it aloud doesn't > help either. I fail to see why this is any different than allowing > identifiers to differ only in case. Kinda true. But the compiler will catch any potential ambiguities. This is the key point. Ada is designed to detect inconsistencies, irregularities, discontinuities, incongruencies, and unconfirmable constructs earlier in the software development process than any other language. One can certainly perform little tricks to thwart this capability, but it requires some effort because Ada goes out of its way to prevent you from doing it. As to the example you cite, we would disambiguate this for the compiler using type qualification: Colour'Amber or Stone'Amber. If we did not, the compiler would reject our code. Richard Riehle