Xref: utzoo comp.object:3420 comp.lang.misc:7683 comp.lang.eiffel:1556 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!gatech!udel!rochester!rocksanne!parc!boehm From: boehm@parc.xerox.com (Hans Boehm) Newsgroups: comp.object,comp.lang.misc,comp.lang.eiffel Subject: Re: A Hard Problem for Static Type Systems Message-ID: Date: 30 Apr 91 20:27:58 GMT References: <1991Apr20.010347.28984@leland.Stanford.EDU> <554@eiffel.UUCP> <1991Apr26.203642.17387@leland.Stanford.EDU> <556@eiffel.UUCP> <1146@tetrauk.UUCP> Sender: news@parc.xerox.com Organization: Xerox PARC Lines: 24 rick@tetrauk.UUCP (Rick Jones) writes: >... It is worth noting that >Craig Chambers' "hard problem" is only irresolvable in a static type system if >you demand contravariance (which he did in his initial posting) - but then most >problems are irresolvable in a useful way with contravariance... Craig Chambers' problem is resolvable in at least some statically typed languages, as is the Polygon-Rectangle example. There are elegant solutions that don't involve inheritance at all. See the discussion in comp.object. (There may also be some that do use inheritance. I'm less of an expert on those. But I haven't seen any discussion of the more aggressive type systems that incorporate inheritance, but obey the contravariance rule, e.g. Cardelli's Quest, or Cook's system.) The original sentence strikes me as a substantial overgeneralization. The problem appears to be unsolvable in a straightforward way using a version of Eiffel's type system that enforces contravariance. Nothing else has been established. Hans (boehm@xerox.com) Usual disclaimers ...