I think your parent was writing Ruby, not Elixir. (Unless this is Ruby's new pattern-matching syntax that I'm not familiar with.)
Re:Cursed Elixir
by Fire-Dragon-DoL on Monday October 19, 2020 @08:49AM
(#24825814)
Indeed if you look at my ruby code, it tries to be a with statement ;)
Correct me if I'm wrong but I think there are 1 (and a half) other ways you could write it - that don't result in branching
1:
1.5: Use a try/rescue block where you match {:ok, obj} and then catch Match errors.