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-19 05:33:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: status of Ada STL? Date: Wed, 19 Jun 2002 14:37:35 +0200 Message-ID: References: <4519e058.0206170753.599fd771@posting.google.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1024489928 9320943 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:26372 Date: 2002-06-19T14:37:35+02:00 List-Id: On 18 Jun 2002 22:32:12 -0700, 18k11tm001@sneakemail.com (Russ) wrote: >Dmitry A.Kazakov wrote in message news:... >> Russ wrote: >> >> > Immediately after the statement "x=3" executes, it becomes true in the >> > mathematical sense, which is why it makes sense. >> >> Nope. Consider C++ having user-defined type conversions. It is very easy to >> write a program in C++ that >> >> SomeClass x; >> >> x=3; >> if (x==3) // false > >I should have been more specific. For any instance x of a built-in >numerical type, the statement "x=3" becomes true in a mathematical >sense immediately after it executes. (If I am wrong, please provide a >counter-example.) 1. From ADT point of view there is no difference between numerical, built-in or whatsoever types and other types. There are good reasons why it should be so. 2. Try [C is a funny language!]: int x; x=1.5; if (x == 1.5) // false -------------------------------- float x; x = 1.00000001; if (x != 1.00000001) printf ("oops!\n"); >> In fact assignment (semantic of) has nothing to do with equality. You may >> have incomparable objects which can be assigned. You may have comparable >> objects that cannot be assigned. You may have objects which have several >> different semantics for assignment (deep/shallow copy/reference) and >> equality (distance/set equality etc). > >That's really all irrelevant to the main point here. If you have two >different objects A and B of the SAME type, What is for two types to be SAME? It is not an easy question as one might think. > then > >someclass A, B; >A = B; >if ( A == B ) ... // better be true! But then if you would insist that it should be so in strict mathematical set-theoretic sense, I would derive from that, that also A'Address = B'Address -- better be true! If A and B are SAME then there should be no way to distingush them. >From programming point of view it has in most cases no sense [however, see LSP]. "==" is not equality it only models one of many possible. >If this doesn't evaluate to true, you have goofy code. Yes, I realize >that asignment can be overloaded in C++ in all kinds of ways, but >that's really a distraction. Your claim that "assignment has nothing >to do with equality" is just plain wrong. Nothing to do with it? Give >me a break! You can start to define what is equality of two fuzzy sets. What is equality of two floating-point numbers. What is equality of two remote servers. What is equality of two people. Go on. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de