comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: OO in Ada
Date: Fri, 04 Oct 2002 13:35:06 -0400
Date: 2002-10-04T13:35:06-04:00	[thread overview]
Message-ID: <1033752899.224298@master.nyc.kbcfp.com> (raw)
In-Reply-To: 3D9D02F3.9090600@worldnet.att.net

Jim Rogers wrote:
 > In C++ this syntax is good for virtual functions
 > but illegal for static functions. This causes nasty
 > problems in C++ template construction.

You don't mean 'virtual' and 'static', you mean
'member function' and 'non-member function'. It's
not so much an issue of nasty problems. It's just
that having two different notations for calling a
method means that when you're writing a template
you have to know which notation to use, which
limits its genericity.

 > C++ (and Java) forbid dispatching based upon the
 > return type of a function. This is one of the
> side effects of the 'object.method' notation.

Your first statement is true, but your second is
false. Why do you think object.method would prevent
dispatching on return type?

> should be phased out by allowing [member] functions
 > to be called in the same way as [non-member] functions.

It will never be phased out, of course, since that would
destroy millions of lines of code. Someone might come up
with a reasonable proposal for allowing the method(object)
notation, though. The problem is the impact this owuld have
on overloading and name lookup, which is already extremely
complicated.

The design issue for C++ is that sometimes you want member
functions as part of an interface and sometimes you want
standalone functions. Having a different calling notation
makes it harder to switch the function from one type to the
other, because you have to modify all the callers.

On the other hand, Ada gives the illusion of multiple dispatch
by allowing several parameters to control dispatching, but then
forcing them all, at runtime, to have the same dynamic type. I
suppose some future version of Ada could lift this restriction
while keeping the same notation, which is good.





  reply	other threads:[~2002-10-04 17:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04  2:14 OO in Ada Rick Duley
2002-10-04  2:55 ` Jim Rogers
2002-10-04 17:35   ` Hyman Rosen [this message]
2002-10-05  0:20     ` Jim Rogers
2002-10-05 23:38       ` Dmitry A.Kazakov
2002-10-05 15:25         ` Jim Rogers
2002-10-06 21:37           ` Dmitry A.Kazakov
2002-10-06  2:18       ` Hyman Rosen
2002-10-06  3:00         ` Jim Rogers
2002-10-08 21:08           ` Gisle Sælensminde
2002-10-04  3:37 ` Chad R. Meiners
2002-10-04  5:32 ` Simon Wright
2002-10-04  6:01 ` tmoran
2002-10-04 15:05 ` Matthew Heaney
2002-10-05  2:14 ` SteveD
2002-10-05  8:54   ` Preben Randhol
2002-10-07 14:10   ` Matthew Heaney
2002-10-07 19:52     ` Jeffrey Carter
2002-10-08 21:18     ` Dmitry A.Kazakov
2002-10-08  9:53 ` John McCabe
2002-10-08 15:37   ` Matthew Heaney
2002-10-08 16:47     ` Georg Bauhaus
2002-10-08 17:48       ` Matthew Heaney
2002-10-08 17:16     ` Warren W. Gay VE3WWG
2002-10-08 17:58       ` Matthew Heaney
2002-10-09 16:59         ` Warren W. Gay VE3WWG
2002-10-08 10:21 ` Preben Randhol
  -- strict thread matches above, loose matches on Subject: below --
1998-05-15  0:00 Gisle S{lensminde
replies disabled

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