On Nov 7, 2007 10:00 AM, Jon Harrop <[EMAIL PROTECTED]> wrote: > > On Wednesday 07 November 2007 05:21, hlovatt wrote: > > Therefore multiple dispatch provides the best of both worlds...
No one seems to have replied, so I thought I would. IANAExpert disclaimers here. :-) Hopefully this will inspire someone who is to clarify... > Does multiple dispatch provide static checking of exhaustiveness and It can do. Take a look at the ML-sub type system for an example of an extension of Hindley-Milner with subtyping and multiple dispatch. The JVM language Nice (almost) implements an extensions of this system. I don't remember the exact mechanism which it uses to do so, but I seem to recall it working pretty well. On the other hand, most multiple dispatch implementations are lispy so don't. > redundancy, and optimizing pattern match compilation via decision trees with Certainly. There are some really heavily optimised CLOS implementations. > the usual pattern matching features (or-patterns, guards and so on)? I don't know. > Also, what are the source code equivalents to the examples I posted? I'd need to think about it. I've not written any Nice in way too long. It would probably be somewhere in between the two in terms of verbosity. In particular there are no implicit sum types. You'd need to define an abstract interface (similar to a Haskell type class) or something. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---