Scope of variable passed to function

Oh sorry wasn’t responding specifically to your question.

But to answer it: Elixir allows variable re-binding, ie, you can say: number = number+ 1 and not get an error that number is already defined. Like =, -> is also a binding operator, so when you say number -> ok(:perfect), number is rebound. The match on the value of number, you need to use the pin operator.