Accessing protected functions

Im trying to understand creating and accessing protected functions.
I have following simple code, but I’m getting error
Im trying to call public function which in turn calls inside a protected function. What is going wrong here?

defmodule Math do

    def add(a,b) do
        c = a+b
        Math.info(a,b,"add", c)
    end



    defp info(a,b,c,d) do
        cond do
            c == "add" -> IO.puts "Adding #{a} and #{b}, result = #{d}" 
        end
    end

end

Math.add(1,2)

Error received

== Compilation error in file math.ex ==
** (UndefinedFunctionError) function Math.info/4 is undefined or private
    Math.info(1, 2, "add", 3)
    (elixir 1.10.4) lib/kernel/parallel_compiler.ex:304: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

Private functions must be called without the name of the module. Replace Math.info(...) with info(...).

1 Like

Thank you!
Quite silly not to realize it myself. I was following Elixir guide but did not notice it.

Note the terminology, these are private functions. Elixir has no notion of protected functions, which is I guess mostly an OOP thing.