[erlang-questions] Guards syntax for multiple values
Fri Mar 29 10:41:20 CET 2019
On Tue, Mar 26, 2019 at 3:51 PM Florent Gallaire <fgallaire@REDACTED> wrote:
> thanks a lot for your attention to this thread.
> > Yes, that would work. As long as the list is a literal, the compiler
> > can rewrite it in a smarter way to reduce the complexity to O(log(N)),
> > which would be acceptable.
> Very happy to hear that it's technicaly feasible and that the
> complexity is acceptable.
I should probably have pointed out in my answer that I don't
recommend implementing a new is_member/2 guard. Just
because it is possible doesn't mean that it is a good idea.
In informal discussions in the OTP team, it seems that
we prefer OR patterns over is_member/2 because OR patterns
would be applicable in more situations.
In fact, if someone would write a good EEP for OR patterns, it
is possible that it could be approved and implemented
as early as in the OTP 23 release.
Björn Gustavsson, Erlang/OTP, Ericsson AB
More information about the erlang-questions