2

I want to create a module at run time in Elixir using a string which contains the module code. In this question it has been said about Code.compile_string and Code.eval methods. Aren't they supporting to Elixir? I'm getting compile errors while using them.

** (UndefinedFunctionError) undefined function: Code.eval/2
Community
  • 1
  • 1
Lahiru
  • 2,609
  • 3
  • 18
  • 29

1 Answers1

8

It's Code.eval_string. You can see the docs here: https://hexdocs.pm/elixir/Code.html#eval_string/3

wadie
  • 496
  • 1
  • 10
  • 24
bitwalker
  • 9,061
  • 1
  • 35
  • 27