(no title)
gamache | 1 year ago
tuple_size/1 is a guard, and guards are built-in. The compiler itself uses them. Unlike regular functions, you are allowed to use guards in a function head, like:
def foo(my_tuple) when tuple_size(my_tuple) == 3 do ...
Official docs: https://hexdocs.pm/elixir/1.16.3/patterns-and-guards.html#gu...
giraffe_lady|1 year ago
gamache|1 year ago