News for hackers. Stuff that matters.
Re:Pattern Matching with TypeScript by platz on Thursday July 06, 2017 @02:17AM (#14708489)
no, but multi-methods are 99% of the time found in dynamic languages, right?
Re:Pattern Matching with TypeScript by rbehrends on Thursday July 06, 2017 @02:41AM (#14708567)
1. Multimethods simply are a rare feature in general.

2. Multiple dispatch and static typing are completely orthogonal features.

3. Strictly speaking, you don't even need multiple dispatch. The key feature of multimethods that you need is the ability to add a method outside the class body.

Re:Pattern Matching with TypeScript by platz on Thursday July 06, 2017 @02:47AM (#14708598)
under definition 3 then extension methods are also multi-methods - doesn't seem right. even c# has extension methods
Re:Pattern Matching with TypeScript by rbehrends on Thursday July 06, 2017 @03:29AM (#14708728)
Extension methods do not support dynamic dispatch and hence are not proper instance methods. Try MultiJava's open classes for an approach that works.