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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,c890e6ab3fb2c5fc X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,c890e6ab3fb2c5fc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-23 02:01:28 PST Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!epflnews!dinews.epfl.ch!lglsun!nebbe From: nebbe@lglsun.epfl.ch (Robb Nebbe) Newsgroups: comp.lang.ada,comp.lang.c++ Subject: calling syntax (was Re: Ada Objects) Date: 23 Jan 1995 10:01:28 GMT Organization: Ecole Polytechnique Federale de Lausanne Sender: nebbe@lglsun3.epfl.ch (Robb Nebbe) Distribution: world Message-ID: <1995Jan23.101143@lglsun.epfl.ch> References: <3f9g1u$j4m@nps.navy.mil> <3flk3r$8qj@gdls.com> NNTP-Posting-Host: lglsun3.epfl.ch Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Xref: nntp.gmd.de comp.lang.ada:18171 comp.lang.c++:87495 Date: 1995-01-23T10:01:28+00:00 List-Id: In article <3flk3r$8qj@gdls.com>, wilkinso@gdls.com (Robert M. Wilkinson) writes: |> In article , |> Kenneth Almquist wrote: |> > |> >C++ has two procedure calling syntaxes. It is possible to write either |> > display(myptr); |> >or |> > myptr->display(); |> |> Please note that these have *entirely* different semantics; they are not |> merely "two forms of syntax" for the same thing. |> I'm not sure you would want to call this a semantic difference. The semantics are the operation display is called with the parameter myptr in both cases. The real difference is in the implementation. The first is just a normal function call like you would find in C (or Ada) in the second the parameter is called "this" inside the function and if it is virtual (and the compiler can't be sure exactly what the pointer points at) then the implementation will be chosen at run-time, otherwise it is called just like a normal function. Robb Nebbe