In this section, we will demonstrate the power and flexibility of functions (example code can be found in Chapter 3\first_class.jl). Firstly, functions have their own type: Function. Functions can also be assigned to a variable by their name:
julia> m = mult julia> m(6, 6) #> 36
This is useful when working with anonymous functions, such as c = x -> x + 2, or as follows:
julia> plustwo = function (x) x + 2 end (anonymous function) julia> plustwo(3) 5
Operators are just functions written with their arguments in an infix form; for example, x + y is equivalent to +(x, y). In fact, the first form is parsed to the second form when it is evaluated. We can confirm it in the REPL: +(3,4) returns 7 and typeof(+) returns Function.
A function can take a function (or multiple...