On Saturday 01 March 2003 08:07 am, Arthur Chance wrote: > Seth Kurtzberg <seth / cql.com> writes: > > On Friday 28 February 2003 10:25 am, Arthur Chance wrote: > > > Seth Kurtzberg <seth / cql.com> writes: > > > > Very true. In my opinion adding Hindley-Milner typing to Ruby would > > > > be a huge gain in reliability. > > > > > > As far as I understand it (which isn't that far), adding > > > Hindley-Milner type inferencing to an OO language with super/sub-type > > > relationships is at least difficult if not impossible. For a take on > > > adding OO to a type inferenced language (SML) rather than adding type > > > inferencing to an OO language take a look at the Moby site: > > > http://moby.cs.uchicago.edu/ > > > > That makes no sense. If you can add super/subtyping to a type inferenced > > language, then you can add type inference to a super/subtype language. > > If it is impossible in one case it is also impossible in the other. > > I think I wasn't clear enough. You can have some type inferencing but > you can't do full Hindley-Milner inferencing in OO systems. If you > read the Moby papers you'll find they have abandoned H-M type > inferencing and you have to declare the types of methods. Given those > they can infer the types of the local variables in the method bodies. > The paper _The design of a class mechanism for MOBY_ by Fisher and > Reppy explicitly states: I don't disagree that you can't do full Hindley-Milner inferencing. However, I do disagree with the (common) assertion that if you can't do full HM inferencing, then it isn't useful to try and to _any_ inferencing. > > Another consequence of supporting subtyping is that ML-style type > inference is not possible. -- Seth Kurtzberg M. I. S. Corp. 480-661-1849 seth / cql.com