User Tools

Site Tools


2019:notes_on_teaching_elixir

Notes on Teaching and Learning Elixir

Ordering for teaching functions

By Bruce Tate:

  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.

Preferred method

Method

Calling functions

Module, function and arguments.

By arity

Zeroary functions

Math.pi()
alias :math, as: Math
Math.pi()

Unary functions

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)

Binary functions

Kernel.max(1,2)  
Kernel.max(2,1)  
Kernel.min(2,1)  
Kernel.div(10,4)
Kernel.rem(10,4)
Kernel.div(10,0)
2019/notes_on_teaching_elixir.txt · Last modified: 2020/11/19 08:42 (external edit)