Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module Introspection
% This method is generated automatically by
% Elixir and is exhibited here as an example.
% def __module_name__
% 'Introspection
% end
def original_inspect
inspect
end
def my_inspect
self.inspect
end
def original_name
% This is a local call to the method generated above.
__module_name__
end
def my_name
% This is a remote call to __module_name__ in the current self.
self.__module_name__
end
end
module Main
mixin Introspection
end
Main.my_name % => 'Main
Main.original_name % => 'Introspection
Main.my_inspect % => "Main"
Main.original_inspect % => "Main"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.