Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

instanceof is but one possible use case. Arguably the most useful part of pattern matching is inside switch expressions, and there is an equivalence between the Visitor pattern and this, but the latter is much more readable and maintainable. Sure, the visitor pattern is not that often used, but in certain niches that make use of ASTs often it is pretty much a must.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: