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

Nit: I think pattern matching would be local the way you are using the term; pattern matching is(/would be) implemented right at the site you use it with some form of if/else clauses that would be verbose, but obviously related to the original code. Your other three examples definitely involve large-scale "non-local" source transformation all over the place to implement them.

I say this because it took me a moment to figure out how those four things went together.



Clojure's core.match is implemented as a macro with almost exactly the technique you mention. It spits out a decision tree built out of conds.




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

Search: