Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#elixir
Question
We can check if a function is of any given arity by using [...]:
Answer

is_function/2

 # check if add is a function that expects exactly 2 arguments iex > is_function ( add , 2 ) true # check if add is a function that expects exactly 1 argument iex > is_function ( add , 1 ) false 

Tags
#elixir
Question
We can check if a function is of any given arity by using [...]:
Answer
?

Tags
#elixir
Question
We can check if a function is of any given arity by using [...]:
Answer

is_function/2

 # check if add is a function that expects exactly 2 arguments iex > is_function ( add , 2 ) true # check if add is a function that expects exactly 1 argument iex > is_function ( add , 1 ) false 
If you want to change selection, open original toplevel document below and click on "Move attachment"

Parent (intermediate) annotation

Open it
We can check if a function is of any given arity by using is_function/2: # check if add is a function that expects exactly 2 arguments iex > is_function ( add , 2 ) true # check if add is a function that expects exactly 1 argument iex > is_function (

Original toplevel document

Basic types - The Elixir programming language
, just remember that Elixir makes a clear distinction between anonymous functions and named functions. Anonymous functions in Elixir are also identified by the number of arguments they receive. <span>We can check if a function is of any given arity by using is_function/2: # check if add is a function that expects exactly 2 arguments iex> is_function(add, 2) true # check if add is a function that expects exactly 1 argument iex> is_function(add, 1) false Finally, anonymous functions can also access variables that are in scope when the function is defined. This is typically refered to as closures, as they close over their scope. Let’s de

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.