Metaprogramming Elixir: Pos. 611

Example: The Language of Macros - Injecting Code - ‘callers_context.exs’ no longer works (Elixir 1.10.4+) (Pos. 600-627)

The function calls inspect __info__(:functions), not sure that ever worked, but inspect __MODULE__.__info__(:functions) still does in my version. Also note that this function __info__/1 is no longer documented, deprecated and might be completely missing in the future.

Since I only have the e-book, I don’t know the page number, only the position.

3 Likes

For all persons since interested only change the code from that:

def friendly_info do
        IO.puts """
        My name is #{__MODULE__}
        My functions are #{inspect  __info__(:functions)}
        """
end

to that:

def friendly_info do
        IO.puts """
        My name is #{__MODULE__}
        My functions are #{IO.inspect Mod.__info__(:functions)}
        """
end