[erlang-questions] Guards syntax for multiple values

Florent Gallaire fgallaire@REDACTED
Tue Mar 26 15:51:08 CET 2019


Hello Björn,

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.

> As José pointed out, all guard BIFs are currently in the Erlang
> module. So most likely there would be a new guard BIF in the erlang
> module called is_member/2 or lists_member/2.

Why do you clearly prefer is_member/2 or lists_member/2 to 'Var in
<list literal>' ?

It's also a good opportunity to make Erlang more modern with a sexy
syntactic sugar...

Cheers

> /Björn
>
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



-- 
FLOSS Engineer & Lawyer



More information about the erlang-questions mailing list