4 ms·
From the little that I know of Elixir, the overloaded methods with pattern matching on the arguments is Elixir-ish.
by gkop 12y ago
From the little that I know of Elixir, the overloaded methods with pattern matching on the arguments is Elixir-ish.
- skrebbel 12y agoIndeed, and that's not what the blog post's router code does.
- MCRed 12y agoIt 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 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.