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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-31 21:20:35 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.onemain.com!feed1.onemain.com!cyclone-sf.pbi.net!206.13.28.33!news.pacbell.net.POSTED!not-for-mail Message-ID: <3B6784C6.200B0B47@sneakemail.com> From: Russ <18k11tm001@sneakemail.com> X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-20mdk i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to make Ada a dominant language References: <3B6555ED.9B0B0420@sneakemail.com> <9ff447f2.0107301653.c8f5e94@posting.google.com> <3B6624E6.DF734E5C@sneakemail.com> <9ff447f2.0107311725.5af099ae@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 31 Jul 2001 21:25:42 -0700 NNTP-Posting-Host: 63.194.87.148 X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 996639634 63.194.87.148 (Tue, 31 Jul 2001 21:20:34 PDT) NNTP-Posting-Date: Tue, 31 Jul 2001 21:20:34 PDT Organization: SBC Internet Services Xref: archiver1.google.com comp.lang.ada:10912 Date: 2001-07-31T21:25:42-07:00 List-Id: Adrian Hoe wrote: > > Russ Paielli <18k11tm001@sneakemail.com> wrote in message news:<3B6624E6.DF734E5C@sneakemail.com>... > > Adrian Hoe wrote: > > > > > > Russ Paielli <18k11tm001@sneakemail.com> wrote in message news:<3B6555ED.9B0B0420@sneakemail.com>... > > > > > > > > Because "=" is the simplest fricking symbol that could possibly be used > > > > for assignment. Why is this so hard for Ada programmers to understand? > > > > What's so great about ":="? Why not use "$=" or "%="? > > > > > > "=" means equal. "IF A = 0 THEN" reads as "if A equals 0 then" and > > > ":=" means assignment. > > > > But "x = 4" means that, immediately after the statement is executed, x > > indeed equals 4. I don't see a problem with using "=" for both > > assignment AND equality testing (am I missing something?). In Python, > > the classic C problem of using "=" when you mean "==" is avoided by > > simply not allowing assignment within an if test. Seems like a simple > > solution to me. In Ada, the compiler would tell you if you get it wrong. > > "=" and ":=" are used to differentiate a condition and assignment > respectively. Someone in the later post mentioned that "=" has > mathematical interpretation and "==" does not. The same goes to ":=". > > Take a look at the code (proposed new Ada): > > if A = 0 then > A = 1; > end if; > > rather than (the original Ada): > > if A = 0 then > A := 1; > end if; I think Python has an extremely simple solution to this so-called "problem". Python simply disallows assignment inside an "if" conditional. This whole "problem" is only a symptom of the short-sightednes of C. (That should score me some points!) > Which is clearer? The use of ":=" has the purposeful meaning in > avoiding confusions in apes like us. Certainly, there is no big deal > with a compiler. Good. Then let the compiler warn you. Russ