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,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-13 09:20:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!feed2.news.rcn.net!rcn!elnk-nf1-atl!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: Fri, 13 Jun 2003 09:22:29 -0700 Organization: AdaWorks Software Engineering Message-ID: <3EE9FA45.FFAFB07@adaworks.com> References: <6a90b886.0305262344.1d558079@posting.google.com> <3EE7CC70.E1FD3A67@adaworks.com> <3EE90854.6456A81E@adaworks.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 3f.bb.88.3a Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 13 Jun 2003 16:20:10 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:39132 Date: 2003-06-13T16:20:10+00:00 List-Id: Russ wrote: > Richard Riehle wrote in message news:<3EE90854.6456A81E@adaworks.com>... > > > I am not sure of the answer to that question. Perhaps others with more > > experience using the syntax might be able to say something about it. I > > do wonder whether there are situations where an accidental misuse > > could cause an undetectable error. Suppose I wrote, "a += 5" when > > I intended, "a := 5". This is quite easy to do because the + and the = > > are both on the same key on my keyboard. It would be a serious error, > > and the compiler would not be able to detect it. Such errors are one > > reason why people writing code in the C family of languages find > > themselves so dependent on debuggers. > > Well, ... I think you're reaching a bit on that one. Anyone who can't > readily tell += from := needs a stronger pair of reading glasses. And > it seems to me they could just as easily confuse + with *, l with 1, > or 0 with O. Good point. However, the compiler will detect the difference between 0 and O. The type model will reject this sort of thing. On the other hand, the compiler will not be able to discern intent when += is used instead of :=. When the compiler cannot detect such a simple error, the proposed syntax violates the fundamental goals of the language design. I can imagine the SPARK Examiner having a conniption trying to prove this construct. Oh, and yes, I am overly cautious. Remember the domain for which Ada code is targeted. One reason the C family of languages is inappropriate for safety-critical software, or any kind of software where dependability is a primary concern, derives from the unprovability of many of the language constructs. If there is a potential ambiguity, and anything derived from C has plenty of potential ambiguities, we must question the value of including it in Ada. Richard Riehle