comp.lang.ada
 help / color / mirror / Atom feed
From: jezequel@piccolo.is.s.u-tokyo.ac.jp (Jean-Marc Jezequel)
Subject: Re: Eiffel and Java  + Ada dispatching
Date: 1996/11/01
Date: 1996-11-01T00:00:00+00:00	[thread overview]
Message-ID: <55cl9q$59m@tjnews.is.s.u-tokyo.ac.jp> (raw)
In-Reply-To: JSA.96Oct30181901@alexandria


In article <JSA.96Oct30181901@alexandria>, jsa@alexandria (Jon S Anthony) writes:

>Actually, while it is not multiple dispatching (multi-methods), the
>syntax does indeed allow several little niceties that the dot notation
>flubs.  It is this stuff that is the "justification" - not any so called
>"hybrid" aspects.
>
>
>1) the dot notation makes the operation _look_ like a field of the object but
>   in general this is _not_ true (some OOLs do have per object methods but
>   not the usual ones like Eiffel, C++, Sather, etc...)

What do you mean? Conceptually it *is* (can be though of as) a field of the object
(if I gather well what you mean by field). That it uses to not be at runtime is a 
compiler optimization. Or do you mean something else?


>2) the dot is asymmetrical and makes many cummutative operations look
>   lopsided.  For example, Union(set_a, set_b) = Union(set_b, set_a), and
>   the notation should reflect this (infix would be even nicer here).  But
>   in "dot land" you have set_a.Union(set_b) which looks like set_a _has_
>   the operation and is "special" somehow.

The problem is much more profound, because if you have single dispatch only, it *is*
"special" somehow, whatever the syntax you use to write it.
For binary operations, it seems that there is no other way
that double-dispatch (built in as in CLOS, or emulated as everywhere else).
Check e.g. the recent article "On Binary Methods" by Bruce, Cardelli et al. in 
Theory and Practice of Object System. Static binding of one of the paramater poses
problem, and in this respect Ada95 does not bring anything new (and in this respect is no
better than C++/Java/Eiffel/Sather etc.). Prove me wrong, please, and win a paper in TPOS.
But please, do not quote me outside of the context this time.

BTW you could write: set_c := set_a + set_b in Eiffel, with the declaration
infix "+" (other: SET): SET is
-- returns union of Current and Other
...

but unless you redispatch on the dynamic type of 'other', it does not solve
the problem.

>3) the function notation allows Ada to dispatch based on the _result_ of
>   parameter which is a function call.  Or has the function dispatch to
>   the right thing based on the other parameters.  Bob Duff gave a couple

I have trouble understanding these sentences. Could you please reformulate
in English or even American English?

>   Union(My_Set, Singleton(X)), where Singleton's dispatching is the
>   controlling _result_ and _not_ the argument (with X being an integer
>   or something).  Here, Singleton would dispatch to the proper version
>   based on the tag of My_Set.
>
>   (Singleton(X) + Singleton(Y)) * My_Set, where "+" is union and "*" is
>   intersection.  Here the tag of My_Set would control the dispatch of
>   the Singleton operations.

Well, I still cannot see what it buys you beyond being able to choose 
at *compile time* (i.e. statically) the position of the parameter that receives
the dispatch (big deal, IMHO) ? Or do you mean something else?
In that case, please give us a more complete example. Or would a real
Ada95 expert tell us? (Yvon, are you still there?)


>> it is special. The downside is that symmetric operations do not
>> appear as such. Well, not really, because you can always regain it
>> by inventing another class for performing symmetric operations:

>> eg. class SET_OPS
>>       ...
>>       union (a, b: SET): SET is ...
>>       intersection (a, b: SET): SET is ...
>>       ...
>>     end

>Well, sort of...  Seems like pretty extraneous futzing to accomplish
>such a simple and ordinary thing.


Dealing with binary methods whose both arguments can be instances of subtypes of the declared
types is *not* a "simple and ordinary thing". Again, if you have such a simple solution,
tell us! I'll praise you then.

>Actually, if you stated this as "for my areas, symmetric ops are
>relatively few", I could buy it.  But in general symmetric operations
>are all over the place.

How can you say that? I agree that they are quite commonplace in math-related software
(linear algebra, sets etc.), and could sometimes appear in other pieces, but not to the
point of being ubiquitous. But that's not the point. Well, what is your point anyway?

---
Jean-Marc Jezequel               | Tel : +81 (3) 3812-2111 ext. 4116
IRISA/CNRS, currently visiting:  | Fax : +81 (3) 5689-4365
Dept. of Information Science     | e-mail : jezequel@irisa.fr  or
Faculty of Science               | e-mail : jezequel@is.s.u-tokyo.ac.jp
The University of Tokyo          | http://www.irisa.fr/pampa/PROF/jmj.html   
Hongo Bunkyo-Ku, Tokyo 113, JAPAN





  reply	other threads:[~1996-11-01  0:00 UTC|newest]

Thread overview: 162+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-27  0:00 Eiffel and Java Vincent WEBER
1996-10-27  0:00 ` Jean-Michel P. Decombe
1996-10-28  0:00   ` Alexandre Oliva
1996-10-28  0:00   ` David Hanley
1996-10-28  0:00     ` Matt Kennel
1996-10-28  0:00   ` Robert Dewar
1996-10-31  0:00     ` Doug Marker
1996-10-29  0:00   ` Chris Trimble
1996-10-31  0:00     ` Doug Marker
1996-10-31  0:00   ` David Bennett
1996-10-28  0:00 ` Matthew Heaney
1996-10-29  0:00   ` Vincent WEBER
1996-10-31  0:00     ` James McKim
1996-11-01  0:00       ` Matthew Heaney
1996-11-04  0:00         ` James McKim
1996-10-30  0:00   ` Don Harrison
1996-10-31  0:00     ` James McKim
1996-11-04  0:00       ` Don Harrison
1996-11-23  0:00       ` Van Snyder
1996-10-30  0:00   ` Jon S Anthony
1996-11-01  0:00     ` Jean-Marc Jezequel [this message]
1996-10-31  0:00   ` Joachim Durchholz
1996-11-01  0:00   ` Norman H. Cohen
1996-11-02  0:00   ` Jon S Anthony
1996-11-02  0:00   ` Eiffel and Java + Ada dispatching Jon S Anthony
1996-11-03  0:00   ` Eiffel and Java Joachim Durchholz
1996-11-05  0:00   ` Norman H. Cohen
1996-10-28  0:00 ` Larry Kilgallen
1996-10-30  0:00   ` Ronald Cole
1996-10-29  0:00 ` Don Harrison
1996-10-29  0:00   ` Eiffel and Java + Ada dispatching Vincent WEBER
1996-10-30  0:00     ` Don Harrison
1996-10-30  0:00       ` Jon S Anthony
1996-10-30  0:00     ` Jean-Marc Jezequel
1996-11-01  0:00       ` Joachim Durchholz
1996-11-01  0:00       ` Don Harrison
1996-10-29  0:00   ` Eiffel and Java Fergus Henderson
1996-10-30  0:00     ` Don Harrison
1996-10-30  0:00       ` Fergus Henderson
1996-10-31  0:00     ` David L. Shang
1996-11-01  0:00       ` Matt Kennel
1996-11-04  0:00         ` David L. Shang
1996-11-05  0:00           ` Matt Kennel
1996-11-06  0:00             ` David L. Shang
1996-11-04  0:00       ` Robert I. Eachus
1996-11-01  0:00     ` Jon S Anthony
1996-11-02  0:00       ` Fergus Henderson
1996-11-04  0:00       ` David L. Shang
1996-11-05  0:00         ` Jon S Anthony
1996-11-02  0:00     ` Darko BUDOR
1996-11-02  0:00       ` Fergus Henderson
1996-11-03  0:00         ` Matt Kennel
1996-11-03  0:00         ` Darko BUDOR
1996-11-03  0:00     ` Matthias Ernst
1996-11-03  0:00     ` Jon S Anthony
1996-11-05  0:00     ` Jon S Anthony
1996-11-10  0:00     ` Marcos F. F. de Macedo
1996-11-11  0:00       ` David L. Shang
1996-11-12  0:00         ` Fergus Henderson
1996-11-12  0:00           ` David L. Shang
1996-11-12  0:00             ` David L. Shang
1996-11-16  0:00             ` Fergus Henderson
1996-11-18  0:00               ` David L. Shang
1996-11-18  0:00             ` Kai Quale
1996-11-18  0:00               ` David L. Shang
1996-11-25  0:00                 ` Kai Quale
1996-11-15  0:00         ` Paul Johnson
1996-11-12  0:00       ` Alexander Asteroth
1996-11-11  0:00         ` Marcos F. F. de Macedo
1996-11-12  0:00         ` Matt Kennel
1996-11-12  0:00         ` Benedict A. Gomes
1996-10-30  0:00   ` Eiffel and Java + Ada dispatching Robert I. Eachus
1996-10-30  0:00   ` Jon S Anthony
1996-11-04  0:00     ` Don Harrison
1996-11-04  0:00       ` C to Ada Ali Mirhosseini
1996-11-04  0:00         ` Matthew Daniel
1996-11-04  0:00         ` Robert Dewar
1996-11-05  0:00       ` Eiffel and Java + Ada dispatching Jon S Anthony
1996-11-05  0:00         ` Don Harrison
1996-11-06  0:00           ` Jon S Anthony
1996-10-30  0:00   ` Eiffel and Java David Petrie Stoutamire
1996-10-31  0:00   ` Eiffel and Java + Ada dispatching Jon S Anthony
1996-11-01  0:00     ` Jean-Marc Jezequel
     [not found]     ` <E06F2B.Az7@syd.csa.com.au>
1996-11-01  0:00       ` Jon S Anthony
1996-11-04  0:00         ` Don Harrison
1996-11-05  0:00           ` Jon S Anthony
1996-11-02  0:00       ` Robert Dewar
1996-11-04  0:00         ` Norman H. Cohen
1996-11-05  0:00         ` Don Harrison
1996-11-05  0:00           ` Joachim Durchholz
1996-11-05  0:00           ` Robb Nebbe
1996-11-06  0:00             ` To overload or not to overload (was Eiffel and Java + Ada dispatching) Don Harrison
1996-11-06  0:00               ` Robb Nebbe
1996-11-07  0:00                 ` Norman H. Cohen
1996-11-07  0:00                 ` Don Harrison
1996-11-07  0:00                   ` Jon S Anthony
1996-11-07  0:00                   ` Juergen Schlegelmilch
1996-11-08  0:00                     ` Don Harrison
1996-11-08  0:00                       ` Don Harrison
1996-11-14  0:00                         ` Jon S Anthony
1996-11-14  0:00                     ` Jon S Anthony
1996-11-07  0:00                   ` Jon S Anthony
1996-11-11  0:00                     ` Don Harrison
1996-11-08  0:00                   ` bill.williams
1996-11-11  0:00                     ` Don Harrison
1996-11-06  0:00             ` Eiffel and Java + Ada dispatching Jean-Marc Jezequel
1996-11-07  0:00               ` Robb Nebbe
1996-11-08  0:00             ` Robert I. Eachus
1996-11-06  0:00           ` Robert I. Eachus
1996-11-08  0:00             ` Don Harrison
1996-11-08  0:00               ` Jon S Anthony
1996-11-08  0:00               ` Robert A Duff
1996-11-12  0:00                 ` Don Harrison
1996-11-12  0:00                   ` Robert A Duff
1996-11-13  0:00                     ` Don Harrison
1996-11-13  0:00                       ` Jon S Anthony
1996-11-15  0:00                         ` Don Harrison
1996-11-19  0:00                           ` Jon S Anthony
1996-11-20  0:00                             ` Don Harrison
1996-11-13  0:00                       ` Robert A Duff
1996-11-14  0:00                         ` Don Harrison
1996-11-12  0:00                   ` Joachim Durchholz
1996-11-15  0:00                     ` Richard Riehle
1996-11-16  0:00                     ` Interfacing contracts (Was: Eiffel and Java + Ada dispatching) Geert Bosch
1996-11-17  0:00                       ` Robert A Duff
1996-11-14  0:00               ` Eiffel and Java + Ada dispatching Robert I. Eachus
1996-11-14  0:00                 ` Robert A Duff
1996-11-15  0:00                 ` Don Harrison
1996-11-15  0:00                   ` Robert I. Eachus
1996-11-19  0:00                     ` Don Harrison
1996-11-18  0:00                       ` Vincent Celier
1996-11-22  0:00                         ` Don Harrison
1996-11-19  0:00                 ` Jon S Anthony
1996-11-15  0:00               ` portmanteau (was Re: Eiffel and Java + Ada dispatching) Robert I. Eachus
1996-11-07  0:00           ` Eiffel and Java + Ada dispatching Robb Nebbe
1996-11-07  0:00           ` Jon S Anthony
1996-11-12  0:00           ` Jon S Anthony
1996-10-31  0:00   ` Joachim Durchholz
1996-11-01  0:00   ` Eiffel and Java Matthias Ernst
1996-11-01  0:00     ` Benedict A. Gomes
1996-11-01  0:00     ` William Clodius
1996-11-02  0:00   ` Eiffel and Java + Ada dispatching Jon S Anthony
1996-11-02  0:00   ` Jon S Anthony
1996-11-04  0:00   ` Eiffel and Java Robert I. Eachus
1996-10-30  0:00 ` Jon S Anthony
1996-11-01  0:00   ` Don Harrison
1996-11-01  0:00     ` Jon S Anthony
1996-11-07  0:00       ` Marcos F. F. de Macedo
1996-11-11  0:00         ` Ian Joyner
1996-11-12  0:00         ` Don Harrison
1996-11-13  0:00           ` Norman H. Cohen
1996-11-15  0:00             ` Don Harrison
1996-11-14  0:00           ` Jon S Anthony
1996-11-15  0:00             ` Don Harrison
1996-11-19  0:00               ` Jon S Anthony
1996-11-21  0:00                 ` Don Harrison
1996-11-12  0:00     ` Jon S Anthony
1996-10-31  0:00 ` Joachim Durchholz
1996-11-01  0:00 ` Jon S Anthony
1996-11-02  0:00 ` Jon S Anthony
1996-11-03  0:00 ` Eiffel and Java + Ada dispatching Joachim Durchholz
1996-11-04  0:00 ` Eiffel and Java Richard A. O'Keefe
replies disabled

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