2 ms·
I really like the proposal for matching values (integral, strings, tuples). It's very lispy. Explicit representation (intrinsics?) of a map used as an expressio
by specialist 7y ago
I really like the proposal for matching values (integral, strings, tuples). It's very lispy. Explicit representation (intrinsics?) of a map used as an expression.
Though I would prefer the keyword 'choose' over 'inspect'.
--
I have noob questions about pattern matching on (polymorphic) types. Please humor:
It's syntactic sugar for std::is_base_of<> (Java's instanceof), right?
This is a consequence of C++ (and Java's) nominal type system, right?
So is pattern matching on types necessary (useful) for structural type systems?
I ask because a friend has been advocating structural typing. He's more of a language theorist whereas I'm more of a language mechanic (I don't even rate as a language engineer). While I'm totally on board with whatever he says, I just hope to better grasp the changes.