Right now everyone teaches anonymous functions first because they are easier to express in iex. Here's our ordering:
— Bruce Tate (@redrapids) April 24, 2019
1. We introduce the concept of a module. Not coding, just the concept.
2. Invoking M.f() in a module
3. defmodule/def.
4. Pipes.
5. Anon f.
I ❤️ this order
By Bruce Tate:
"If you want to teach someone a real skill, teach him how to fail. He will never learn it in school." - @nntaleb
— Nassim Nicholas Taleb's Wisdom (@TalebWisdom) May 30, 2019
Module, function and arguments.
Math.pi() alias :math, as: Math Math.pi()
Kenel.abs(-34) Kernel.abs (-34) Kernel.absolute(-34)
Kernel.abs(-34) Kernel.abs -34 Kernel.abs (-34) Kernel.round(34.6) Kernel.floor(34.6) Kernel.ceil(34.9)
Kernel.max(1,2) Kernel.max(2,1) Kernel.min(2,1) Kernel.div(10,4) Kernel.rem(10,4) Kernel.div(10,0)