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,c890e6ab3fb2c5fc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-24 22:19:51 PST Path: nntp.gmd.de!newsserver.jvnc.net!yale.edu!yale!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gatech!swrinde!pipex!uunet!gwu.edu!seas.gwu.edu!dobrien From: dobrien@seas.gwu.edu (David O'Brien) Newsgroups: comp.lang.ada Subject: Re: ADA Objects Help! Followup-To: comp.lang.ada Date: 25 Jan 1995 06:19:51 GMT Organization: George Washington University Distribution: world Message-ID: <3g4qi7$g07@cronkite.seas.gwu.edu> References: <3f9g1u$j4m@nps.navy.mil> <3flk3r$8qj@gdls.com> <3g1f75$fj1@thecourier.cims.nyu.edu> NNTP-Posting-Host: 128.164.9.3 X-Newsreader: TIN [version 1.2 PL2] Date: 1995-01-25T06:19:51+00:00 List-Id: Ed Osinski (osinski@hellgate.cs.nyu.edu) wrote: : |> > : |> >C++ has two procedure calling syntaxes. It is possible to write either : |> > display(myptr); : |> >or : |> > myptr->display(); : |> : |> >These both call a procedure, passing the value myptr as the argument. : |> >In contrast, Ada provides only a single procedure call syntax. : |> > : |> >When you declare a procedure in C++ you specify which syntax will be : |> >used to call the procedure. : |> : |> Again, there is much more to it than just the syntax. One is a member : |> function, the other is a plain-old function. Big, big, difference. : Sure, but why does the caller need to know which one is used? Point is, you don't. The first form really won't exist in OOP. Problem is both Ada and C++ are hybrid OO languages. So we keep thinking in our old imperative way, while trying to implement in an OOP way. I'm kinda surprised to see this actually since in Ada it is common to see "text_io.put_line( .... );". So why does the programmer have to know which package ``put_line'' belongs to? Yes we could just "use" the package, but then you've never worked on a DoD contract that forbidden the use of "use" statements. Actually, it is this syntax and scoping rules that gave Ada83 a partially OO feel. Plus, it is self-documenting code. :-))) : for calling them. In fact, even C++ does let you use the non-member syntax : for *some* members. They're called operators. When you see : a + b Same syntax as Ada83. You could use package_name.op( a, b ); -- David O'Brien (dobrien@seas.gwu.edu)