We can invoke anonymous functions by passing arguments to it. Note that a dot (.) between the variable and parentheses is required to invoke an anonymous function. Why is that?
Answer
The dot ensures there is no ambiguity between calling the anonymous function matched to a variable add and a named function add/2.
Tags
#elixir
Question
We can invoke anonymous functions by passing arguments to it. Note that a dot (.) between the variable and parentheses is required to invoke an anonymous function. Why is that?
Answer
?
Tags
#elixir
Question
We can invoke anonymous functions by passing arguments to it. Note that a dot (.) between the variable and parentheses is required to invoke an anonymous function. Why is that?
Answer
The dot ensures there is no ambiguity between calling the anonymous function matched to a variable add and a named function add/2.
If you want to change selection, open original toplevel document below and click on "Move attachment"
Parent (intermediate) annotation
Open it We can invoke anonymous functions by passing arguments to it. Note that a dot (.) between the variable and parentheses is required to invoke an anonymous function. The dot ensures there is no ambiguity between calling the anonymous function matched to a variable add and a named function add/2
Original toplevel document
Basic types - The Elixir programming language nd returns the result of a + b. The arguments are always on the left-hand side of -> and the code to be executed on the right-hand side. The anonymous function is stored in the variable add. <span>We can invoke anonymous functions by passing arguments to it. Note that a dot (.) between the variable and parentheses is required to invoke an anonymous function. The dot ensures there is no ambiguity between calling the anonymous function matched to a variable add and a named function add/2. We will write our own named functions when dealing with Modules and Functions. For now, just remember that Elixir makes a clear distinction between anonymous functions and named functi
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised 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.