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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f51e93dacd9c7fca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-18 03:58:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada References: <3d0ce154_5@news.bluewin.ch> <3D0D4274.6C5E02F9@acm.org> <4519e058.0206170753.599fd771@posting.google.com> Subject: Re: status of Ada STL? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Tue, 18 Jun 2002 11:57:50 +0100 NNTP-Posting-Host: 80.5.140.234 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 1024397895 80.5.140.234 (Tue, 18 Jun 2002 11:58:15 BST) NNTP-Posting-Date: Tue, 18 Jun 2002 11:58:15 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:26227 Date: 2002-06-18T11:57:50+01:00 List-Id: "Russ" <18k11tm001@sneakemail.com> wrote in message news:bebbba07.0206172352.3658a885@posting.google.com... > dennison@telepath.com (Ted Dennison) wrote in message news:<4519e058.0206170753.599fd771@posting.google.com>... > > This isn't just theory, I've seen it confuse quite a lot of people who > > are new to programming. > > Anyone who is "confused" by this for long should find another > profession -- like moving furniture. Shouting at everyone and insulting ppl? > Immediately after the statement "x=3" executes, it becomes true in the > mathematical sense, which is why it makes sense. No, equalities are invariant on their domains. This is why the following works sumTwo :: Int -> Int -> Int sumTwo x y = x + y sumTwo.0 double :: Int -> Int double x = sumTwo x x double.0 Using those rules we get double x = sumTwo x x using double.0 double x = x + x using sumTwo.0 (which is always true!) and this doesn't addTwo :: Int -> Int addTwo x = (y = y + 2) where y = x (it's a bad example and artificial but it's simple). The functions sumTwo and double make perfect sense to anyone who've done maths at any level even if they don't know Haskell. addTwo otoh makes no sense if you show it to someone who doesn't know that "=" means assignment and not equality, and most (if not all) ppl who learn programming/computing science have done maths and will be used to '=' for equality. Let's evaluate it with '=' as equality addTwo x = (y = y + 2) where y = x y = y + 2 and y = x y = x + 2 and y = x x = x + 2 which isn't true for the definition of addition on the domain of Ints (it says 0 = 2). Now for assignment addTwo x = (y = y + 2) addTwo x = y + 2 addTwo x = x + 2 it works, but you have to know '=' means assigment and not equality. > I agree this is a problem, albeit a very minor one. The rational for > using "=" for assignment rather than equality testing is that > assignment is done far more often than equality testing. That's not a good reason. > You claim that people don't like ":=" because they are not "used to > it." Well, that may be part of it, but I think you are defending it > mainly because you are "used to it". Don't know about Ted, but I'm defending it because it's not confusing and more mathematically minded for "=" to mean equality. I also think you're defending '=' because your used to it and for no other reason. Anyone want to get back to serious issues, like the STL? Chris