3 ms·
My comment's a little out of place. I'm not against pattern matching, but for double dispatch; we can have both. Their initial motivating examples was bare ins
by hyperpallium 8y ago
My comment's a little out of place. I'm not against pattern matching, but for double dispatch; we can have both.
Their initial motivating examples was bare instanceof, but I now see they extend it.
How would destructuring fit this model ?!
- aardvark179 8y agoBrian Goetz has writes quite a bit about ongoing projects. The latest article he has done about pattern matching is I think http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.h.... There is a load of stuff in there about destructuring patterns from about half way down.
- hyperpallium 8y agoThanks, a methodical article! Not keen on special support required for destructuring. Nice that they discuss Visitor pattern (and the switch example for such cases looks nice). They don't dicuss double dispatch - but not relevant to them.