<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry, I missed that point. The -file declarations are for getting the correct debugging info and compiler error messages. The source entry in module_info is a different thing. Looking in compile.erl, it seems that if you compile from forms, the source file is always set to "" (and then later, a call to dirname() turns this into ".", which is then passed to absname() before it is sent to beam_asm, so that's why you get your current directory). Perhaps you could patch compile.erl and submit your change to <a href="mailto:erlang-patches@erlang.org" target="_blank">erlang-patches@erlang.org</a>?</blockquote>

<div><br></div><div>Thanks for the reply.</div><div>I will work on a patch, what do you think about compile:forms(Forms, [{source,"path/to/source"]}) as API?</div></div>