#elixir
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
If you want to change selection, open document below and click on "Move attachment"
Basic types - The Elixir programming languagend 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 read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details