Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uwm.edu!bionet!parc!boehm From: boehm@parc.xerox.com (Hans Boehm) Newsgroups: comp.object Subject: Re: A Hard Problem for Static Type Systems Message-ID: Date: 24 Apr 91 17:45:48 GMT References: <1991Apr20.010347.28984@leland.Stanford.EDU> <1991Apr24.032543.11704@leland.Stanford.EDU> Sender: news@parc.xerox.com Organization: Xerox PARC Lines: 25 It seems to me that this problem fundamentally has very little to do with object oriented programming. Expressing things in terms of a subtype hierarchy confuses the issue and contributes nothing. In Russell, the min function has signature: func [x,y: val T; T: type { < }] val T It's a function of two values of type T, and of the type T itself. T is expected to include a < operation. (I get to cheat slightly, in that operations like < have the "right" type by default.) The third (type) parameter will be inferred for each call, and is not explicitly needed, except in the declaration of min. It would be nice if I could annotate "<" with some properties (e.g. the fact that it should be transitive). Languages like IBM's Scratchpad have mechanisms for doing that. Cardelli's Quest language combines this kind of mechanism with inheritance. (Quest and Russell differ in other profound respects. But those have nothing to do with this discussion.) Hans (boehm@xerox.com) Usual disclaimers ...