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

From the little that I know of Elixir, the overloaded methods with pattern matching on the arguments is Elixir-ish.


Indeed, and that's not what the blog post's router code does.


It is in fact what is done with the blog post's router code.

Phoenix gives a high level DSL for routes, which is created using macros that result in a pattern match: exactly the alternative suggested.

For example: http://slides.com/chrismccord/rise-of-the-phoenix#/7

Thus you get the convenience of writing routes the way you want, and the resulting code has the speed of pattern matching.




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

Search: