Functions
Functions are the parts of your code that do something. Your functions are where you define the behaviour of your application.
You have already met some functions: count
, conj
, first
, rest
Maths operators are functions too: +
, -
, `,
/`
We can write our own functions too.
Affect behaviour with arguments
Arguments are values given to a function that could change the result of calling the function.
Functions return a value
A Function always returns a value, even if that value is nil
.
Always returning a value makes it easy for Clojure to use functions as an argument to another function.
- Reference: Basics of Function