When you compile a file in the shell you are actually doing two separate operations: compile the source file to a beam file, and then load the beam file into the system. The erlang shell built-in function c(ModName) does these operations using the vanilla erlang compiler. There is no such special support in the erlang shell for LFE.<br>
<br>This means that you have to explicitly do the two separate steps. First compile the LFE file using lfe_comp:file/1 and then load in the beam file using the shell built-in function l(ModName). So for test.lfe you would do:<br>
<br>21> lfe_comp:file("test.lfe").<br>{ok,test}<br>22> l(test).<br>{module,test}<br><br>The lfe compiler understands if you give the file without the .lfe extension so you can write lfe_comp:file(test).<br>
<br>In the LFE shell the builtin shell function (c 'test) compiles and loads an LFE file. To compile vanilla erlang files there is the builtin shell function (ec 'test).<br><br>Please let me know how you get on with LFE.<br>
<br>Robert<br><br><div class="gmail_quote">2008/12/13 Raoul Duke <span dir="ltr"><<a href="mailto:raould@gmail.com">raould@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hello,<br>
<br>
i'm seeking help understanding how to use lfe_comp in the shell.<br>
apologies for my cluelessness. when using the erl shell, it seems to<br>
let me redefine (replace) a function by recompiling the file. however,<br>
lfe_comp:file/1 doesn't seem to do that; the function is, as far as i<br>
can tell, retaining its old behaviour. (also, if i have test.lfe with<br>
foo/1 and test.erl with foo/1 then lfe_comp:file(test) won't result in<br>
foo/1 being from test.lfe, but will still be from test.erl.)<br>
<br>
thanks for any insights.<br>
sincerely.<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>