Article View: gnu.g++
Article #473Re: On relaxing an unnecessary restrict
From: johnson
Date: Sat, 16 Dec 1989 17:39
Date: Sat, 16 Dec 1989 17:39
18 lines
1425 bytes
1425 bytes
William Cook wrote a paper in the 1989 ECOOP that does a good job of describing the issue in type systems for object-oriented languages. The main purpose of the paper was to describe a flaw in the Eiffel type system (he also showed how to fix it), but the paper also argued that it is usually not very useful for a function in a subclass to have a different return type or argument type that in a superclass. This is because polymorphic routines that can take an object of either the subclass or superclass have to assume the most general, i.e. the superclass. He also argued that what is really needed in those cases when you want to change the return type or argument type is to parameterize the class with the type. Thus, the problem with C++ is not so much that you can't change the types of functions in subclasses, it is that C++ doesn't have parameterized classes (yet). Ralph Johnson -- U. of Illinois at Urbana-Champaign
Technical Details
Message-ID:
<110400001@p.cs.uiuc.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!p.cs.uiuc.edu!johnsonReferences:
<10437@<25875AF6>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!p.cs.uiuc.edu!johnson From: johnson@p.cs.uiuc.edu Newsgroups: gnu.g++ Subject: Re: On relaxing an unnecessary restrict Message-ID: <110400001@p.cs.uiuc.edu> Date: 16 Dec 89 17:39:11 GMT References: <10437@<25875AF6> Lines: 18 Nf-ID: #R:<25875AF6:10437:p.cs.uiuc.edu:110400001:000:933 Nf-From: p.cs.uiuc.edu!johnson Dec 15 13:25:00 1989