Re:The Logical Disaster of Null
by lmm on Monday May 21, 2018 @05:38AM
(#17117184)
> In flow typing you replace the control flow part of pattern matching with `if x.is_a? Type`
Hmm, I guess flow typing lets you do an exhaustiveness check of an if-else style set of cases. Still seems like a syntactic shortcut would be nice, just as one misses "switch" in Python.
Re:The Logical Disaster of Null
by lmm on Tuesday May 29, 2018 @09:35AM
(#17178995)
If you can switch on the type of a variable and have it have the relevant type within each switch arm I'd consider that to be pattern matching, though I guess that's just semantics.
Hmm, I guess flow typing lets you do an exhaustiveness check of an if-else style set of cases. Still seems like a syntactic shortcut would be nice, just as one misses "switch" in Python.