Re: Java static binding for parameters and covariance/contravariance

Ivan Boldyrev <boldyrev+nospam@cgitftp.uiggm.nsc.ru>
28 Nov 2004 23:20:00 -0500

          From comp.compilers

Related articles
Java static binding for parameters and covariance/contravariance lujoplujop@gmail.com (Lujop) (2004-11-19)
Re: Java static binding for parameters and covariance/contravariance newsserver_mails@bodden.de (Eric Bodden) (2004-11-20)
Re: Java static binding for parameters and covariance/contravariance vbdis@aol.com (2004-11-20)
Re: Java static binding for parameters and covariance/contravariance mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2004-11-20)
Re: Java static binding for parameters and covariance/contravariance lujoplujop@gmail.com (Lujop) (2004-11-26)
Re: Java static binding for parameters and covariance/contravariance vbdis@aol.com (2004-11-26)
Re: Java static binding for parameters and covariance/contravariance boldyrev+nospam@cgitftp.uiggm.nsc.ru (Ivan Boldyrev) (2004-11-28)
| List of all articles for this month |

From: Ivan Boldyrev <boldyrev+nospam@cgitftp.uiggm.nsc.ru>
Newsgroups: comp.compilers
Date: 28 Nov 2004 23:20:00 -0500
Organization: this field is intentionally left blank
References: 04-11-070 04-11-076
Keywords: Java
Posted-Date: 28 Nov 2004 23:20:00 EST

On 8935 day of my life Eric Bodden wrote:
> A few months ago I banged my head against this static binding issue
> and I really found the Java approach not intuitive at all. I
> personally have the opinion that if one had a method
>
> void handle(Object o) {...}
>
> void handle(SpecialObject s) {...}
>
> then the latter should be seen as a specialization of the former. Of
> course then one would have other issues however: What about if one
> wants to call the first method ("super"-like) from the second one -
> does one want to allow this at all? There were more issues, I cannot
> remember right now...


SpecialObject s=...;
Object b=s;


handle(b); // Former method is called
handle(s); // Latter method is called


--
Ivan Boldyrev


                                    Sorry my terrible English, my native language is Lisp!


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.