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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: David Starner Subject: Re: Ada OO Mechanism Date: 1999/05/24 Message-ID: <3749FF7D.F17CE16A@aasaa.ofe.org>#1/1 X-Deja-AN: 481761194 Content-Transfer-Encoding: 7bit References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc02.worldnet.att.net 927603927 2718 153.37.75.120 (25 May 1999 03:45:27 GMT) Organization: AT&T WorldNet Services Mime-Version: 1.0 NNTP-Posting-Date: 25 May 1999 03:45:27 GMT Newsgroups: comp.lang.ada Date: 1999-05-25T03:45:27+00:00 List-Id: bob wrote: > > In article <3749E9EC.2842436A@aasaa.ofe.org>, David says... > > > > >Think of vectors and the dot product. C++ forces you to view one vector > >as significant (a becomes "this" inside dot function, it's called > >a.dot(b)), even though in a dot b, a and b are equal significance - dot > >product is a symmetric function. Ada makes them of equal importnatce in > >the dot function body and call. > > Are sure you are not talking about Java (which does not have user defined > operators) ? Yes. I was discussing a.dot(b) vs. dot(a,b), not user defined operators. > > You have to do the above in Java 'a.dot(b)' > > but in C++, (unless '.' is one of those few things that are not > allowed to be redefined), I can write 'a.b' just fine, why not? First, I don't believe . is allowed to be redefined. Second, "." is not the dot product dot (which I can't represent in ASCII.) Third, redefining "." is evil - "." in C++ is a synatic element, not a multiplicitave operator, and changing that is going to really confuse any reader of the code.