Announcing Subvisual Live Talks: @zamith, @joshuaclayton, @sasajuric and more! Macro See, Macro Do

Execute dynamic code in Elixir

Sometimes you might need to execute code dynamically based - for instance - on the name of a module, akin to code reflection on other languages.

In Elixir one way this can be achieved is by using Erlang’s :code module. As an example, say you want to run a function in a module named MyProject.Foo.

Read the rest on my blog pedroassuncao.com