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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: jezequel@piccolo.is.s.u-tokyo.ac.jp (Jean-Marc Jezequel) Subject: Re: Eiffel and Java + Ada dispatching Date: 1996/10/30 Message-ID: <557ce3$ojh@tjnews.is.s.u-tokyo.ac.jp>#1/1 X-Deja-AN: 193225707 sender: jezequel@irisa.fr (Jean-Marc Jezequel) references: <550sm2$sn1@buggy.news.easynet.net> <5563vp$1of@buggy.news.easynet.net> to: Sacha@easynet.fr (Vincent WEBER) organization: Dept. Info., Univ. Tokyo newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1996-10-30T00:00:00+00:00 List-Id: In article <5563vp$1of@buggy.news.easynet.net>, Sacha@easynet.fr (Vincent WEBER) writes: >In article , donh@syd.csa.com.au says... >>Don't mistake Ada's symmetrical syntax for multiple dispatching (binding >>driven by more than one parameter). Ada is still single dispatched so for >>dispatching operations, the symmetry is syntactic rather than semantic. >Hum... I'm lost, two ada specialists saying two different things :) Let me cote >an article from the french magazine "L'Objet" (Vol 1, no 1, Spring 95), by > type TILABLE_WINDOW is new WINDOW; > TILE(A,B : TILABLE_WINDOW); > -- display the two window one under the other > -- in covering all the screen > MAIN_WINDOW, MESSAGE_WINDOW : TILABLE_WINDOW; > TILE(MAIN_WINDOW, MESSAGE_WINDOW); > -- the call is perfectly symetric. the parameters can be swapped > -- in C++ we would have had a dissymetric call like: > -- MAIN_WINDOW.TILE(MESSAGE_WINDOW); >Well I think that one of the two parts is wrong :) any comment ? No. Both are (seems to be, cause the Ada95 fragment lacks details) right. 1) Ada95 is still single dispatched 2) but this is combined with the static overloading inherited from Ada83; which is merely syntactic sugar for routine having (statically) different signatures. In this respect, it is exactly like C++ or Java, but for the symetric syntax. May be the confusion comes form the fact that in CLOS, this symetric syntax is used for the real thing: multiple dispatch. The only thing you really need to make use of OO polymorphism is dynamic binding. While having at the same time static overloading can make some code fragment more "natural" to write, the apparent proximity of this feature with dynamic binding yield so much confusion on the non-expert eyes that you do not wonder why I prefer to teach Eiffel rather than C++, Java or even Ada95. As an aside, I once wrote a paper on how to emulate multiple dispatch in a parallel linear algebra library in Eiffel, and it was refused on the ground that a well known existing library had already solved the problem using C++ overloading. Even this "expert" C++ referee had no clue on the difference between static and dynamic binding :-( --- 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