Re:Pattern Matching with TypeScript
by platz on Thursday July 06, 2017 @01:41AM
(#14708371)
it is well known the expression problem is trivial in dynamic (untyped) languages—however, static type safety is a requirement of the problem definition of the expression problem.
[ Parent
| on HN ]
I didn't mention dynamic typing anywhere?
no, but multi-methods are 99% of the time found in dynamic languages, right?
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.
under definition 3 then extension methods are also multi-methods - doesn't seem right. even c# has extension methods