Hi
I tried you suggestion José, but didn't get it to work. I have the following code:
defmodule Example do
def f("ale"), do: 1
def f("alabama"), do: 2
def f("alhambra"), do: 3
end
I compile it then successfully load the abstract code:
{:ok, x} = :beam_lib.chunks('/home/lhc/dev/temp/Elixir.Example', [:abstract_code])
But running :compile.forms(x) gives me this:
: internal error in transform_module;
crash reason: function_clause
in function compile:compile_options/1
called as compile:compile_options({'Elixir.Example',
[{abstract_code,
{raw_abstract_v1,
[{attribute,0,compile,no_auto_import},
{attribute,1,file,{"example.exs",1}},
{attribute,1,module,'Elixir.Example'},
....
{clause,4,
[{bin,0,[{bin_element,0,{string,0,"alhambra"},default,default}]}],
[],
[{integer,0,3}]}]}]}}]})
in call from compile:transform_module/1 (compile.erl, line 897)
in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 292)
in call from compile:fold_comp/3 (compile.erl, line 310)
in call from compile:internal_comp/4 (compile.erl, line 294)
in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153)
:error
Any ideas what I'm doing wrong? I was wondering if maybe I need to pass some options and use :compile.forms/2, but didn't find any options that seemed appropriate.
Cheers,
Lars