|
|
|
|
|
by pmontra
2540 days ago
|
|
The idiomatic way to do that is to match errors in the else branch of the with statement. I've been using Elixir and Phoenix for a customer for a couple of years. It's ok to great, especially when spawning jobs, with some stains. I'm not a great fan of the with syntax. I wish they implemented it as a native statement of the language instead of as a macro. In that way they probably could let us write the same code inside and outside a with, instead of having to transform = into <- and add a comma. But the worst offenders are GenServers. They should really have the syntax of OO classes instead of the incomprehensible handle* functions. After all that's what they are, objects with their own CPU. (Remember Armstrong about Erlang being the only true OO language?) By the way, that would make it easier to code, to understand and to migrate people from imperative languages. |
|