comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: ADA Objects Help!
Date: 22 Jan 1995 13:06:04 -0500
Date: 1995-01-22T13:06:04-05:00	[thread overview]
Message-ID: <3fu6qc$pc5@gnat.cs.nyu.edu> (raw)
In-Reply-To: 3flk3r$8qj@gdls.com

Rob Wilkinson, if you cannot see that from a purely semantic point of view
there is nothing particularly special about member functions, then maybe
it is you who need a better C++ book.

You are viewing them through a semantic filter which says that you will
view these member functions in a special way, corresponding to a particular
paradigm that you (and the language design!) have in mind. However, if you
can manage to take a more basic viewpoint, you will see that member functions
are just functions, nothing more and nothing less. THey have a special
syntax and visibility, but that does not mean they are semantically
fundamentally different from ordinary functions.

YOu may just be to wrapped up in your viewpoint to see the point that several
people have made to you, certainly it does not seem to be registering.

Basically we have functions that can be used as ordinary functions and 
functions that you want to associate with a particular "object". Note
incidentally that at the language level, C++ does not have objects, it
has special structures that are called classes that may be particularly
well suited for the representation of objects, but they are not objects,
because the concept of object has to do with programming paradigms, NOT
with the language design.

In Ada 95, this same programming paradigm (objects and member functions,
probably better called methods in this context, since member functions is
just a syntactic designation), are represented by tagged types and associated
primitive subprograms with controlling arguments.

Just as in C++, classes and member functions may be used to represent
objects and methods, but of course have many other uses, in Ada 95,
tagged types and primitive operations of these types may be used
to present objects and methods.

The semantics in this correspondence are pretty much identical, although the
Ada 95 model is a little more flexible in that one can have more than one
appearence of the tagged type in the parameter list, which together act as
a controlling operand. THis is not important if you are strictly representing
objects and methods, but can be very useful in other contexts.

I think the reason that no one understands what you are saying, and 
consequently that you are getting frustrated, is that you are starting
out from some fundamental assumptions that are false:

   classes in C++ represent objects, false, they can be used to represent
   objects, but that is a programmer choice.

   member functions in C++ are methods. again false, they can be used for
   this purpose, but that is a programmer design choice.

Then you add to it your apparent feeling that this particular usage is
critical enough that it is important to give it a separate syntax. The
trouble is that this introduces multiple syntaxes for identical semantic
concepts (at the language level), and in the Ada 95 design we consider
it an advantage that no separate syntax is used. It leads to a much more
flexible capability, with all the power of the corresponding C++ constructs
and additional capabilities.

In C++, classes are often used for purposes other than the representation of
objects. For instance, in the absence of name spaces, they are used to
represent packaging of entities quite often, and in this context the special
syntax for member functions can definitely get in the way (e.g. if the
function is a binary operator operating on the class type).




  reply	other threads:[~1995-01-22 18:06 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3f9g1u$j4m@nps.navy.mil>
     [not found] ` <D2H5un.FEr@nntpa.cb.att.com>
     [not found]   ` <3fcs59$70s@nps.navy.mil>
     [not found]     ` <3ff186$c19@gnat.cs.nyu.edu>
1995-01-17 17:57       ` ADA Objects Help! Mats Weber
1995-01-18 17:47         ` Robert Dewar
1995-01-20 16:04           ` Mats Weber
1995-01-21 18:59             ` Robert Dewar
1995-01-23 12:03               ` Robb Nebbe
1995-01-25 20:44                 ` Mats Weber
1995-01-25 20:44               ` Mats Weber
1995-01-27  4:03                 ` Robert Dewar
1995-01-26  3:36           ` swdecato
     [not found]         ` <3fhggr$11dp@watnews1.watson.ibm.com>
     [not found]           ` <Mats.Weber-1901951739360001@mlma11.matrix.ch>
1995-01-20 17:22             ` Norman H. Cohen
1995-01-23 16:37               ` Mats Weber
1995-01-25 20:44               ` Mats Weber
1995-01-27  4:05                 ` Robert Dewar
1995-01-19 11:57   ` Robert M. Wilkinson
1995-01-22 18:06     ` Robert Dewar [this message]
1995-01-24 22:18       ` Norman H. Cohen
1995-01-25  1:26         ` swdecato
1995-01-25 18:18           ` Bob Kitzberger
1995-01-25 20:11             ` Bob Kitzberger
1995-01-26 15:31           ` Norman H. Cohen
     [not found]           ` <D330pK.M1@nntpa.cb.att.com>
1995-01-28 21:46             ` John DiCamillo
1995-01-30 14:13               ` David Emery
1995-01-30 22:50               ` Subject/Object Confusion Syndrome [was: Ada Objects Help] John Volan
1995-02-01 14:33                 ` Norman H. Cohen
     [not found]                   ` <D3DpJu.4nK@swlvx2.msd.ray.com>
     [not found]                     ` <D3H7J3.B2x@inmet.camb.inmet.com>
1995-02-06 10:32                       ` Robb Nebbe
     [not found]                     ` <3gu21g$ch@portal.gmu.edu>
1995-02-06 14:01                       ` John Volan
1995-02-01 22:37                 ` Maarten Landzaat
     [not found]                   ` <3h1ahp$gf5@gnat.cs.nyu.edu>
     [not found]                     ` <3h3jmp$1h1@Starbase.NeoSoft.COM>
1995-02-07 14:39                       ` John Volan
1995-02-09  2:25                         ` David Weller
1995-01-29 18:19             ` ADA Objects Help! mat
     [not found]               ` <1995Feb5.180601@hobbit>
1995-02-07 23:04                 ` Subject/Object Confusion Syndrome [was: Ada Objects Help] John Volan
1995-01-25  9:48       ` ADA Objects Help! mat
1995-01-23 10:01     ` calling syntax (was Re: Ada Objects) Robb Nebbe
1995-01-23 18:08       ` John DiCamillo
1995-01-23 23:47     ` ADA Objects Help! Ed Osinski
1995-01-25  6:19       ` David O'Brien
     [not found] ` <1995Jan16.132400@lglsun.epfl.ch>
     [not found]   ` <131279@cup.portal.com>
1995-01-20 16:52     ` Ada " Robert Dewar
1995-01-22 18:30       ` Tucker Taft
1995-01-24 22:09         ` Jacob Sparre Andersen
1995-01-26 16:20           ` Robert A Duff
1995-01-27 17:04             ` Robert A Duff
1995-01-27 19:58             ` Tucker Taft
1995-01-20 17:41   ` Mark S. Hathaway
1995-01-23 10:41     ` Robb Nebbe
1995-01-23 11:53     ` Stephane Barbey
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox