<font face="verdana,sans-serif">That did the trick. Thanks :)<br clear="all"></font><div style="text-align:right"><font face="verdana, sans-serif"><b><i><a href="http://google.com/profiles/greenmellon" target="_blank">Fernando Benavides</a></i></b></font></div>
<br>
<br><br><div class="gmail_quote">On Thu, Nov 24, 2011 at 1:07 PM, Håkan Mattsson <span dir="ltr"><<a href="mailto:hm@tail-f.com">hm@tail-f.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Try with adding this compiler directive:<br>
<br>
-mode(compile).<br>
<br>
/Håkan<br>
<div><div class="h5"><br>
On Thu, Nov 24, 2011 at 4:48 PM, Fernando Benavides<br>
<<a href="mailto:fernando.benavides@inakanetworks.com">fernando.benavides@inakanetworks.com</a>> wrote:<br>
> Hi all,<br>
><br>
> Today I've run into a new (to me, at least :P) tricky situation in escript.<br>
> Check the following script:<br>
>><br>
>> #!/usr/bin/env escript<br>
>><br>
>> add1(X) -> X + 1.<br>
>> main(_Args) -> lists:map(fun add1/1, lists:seq(1,10)).<br>
><br>
> If you try to run it, it fails with the following message:<br>
><br>
>> escript: exception error: undefined function erl_eval:add1/1<br>
><br>
> If you try this one instead...<br>
><br>
>> #!/usr/bin/env escript<br>
>><br>
>> add1(X) -> X + 1.<br>
>> main(_Args) -> lists:map(fun ?MODULE:add1/1, lists:seq(1,10)).<br>
><br>
> Then you get...<br>
><br>
>> priv/test:3: Warning: function add1/1 is unused<br>
>> escript: exception error: undefined function<br>
>> test__escript__1322__149559__518984:add1/1<br>
>> in function lists:map/2<br>
>> in call from erl_eval:local_func/5<br>
>> in call from escript:interpret/4<br>
>> in call from escript:start/1<br>
>> in call from init:start_it/1<br>
>> in call from init:start_em/1<br>
><br>
> It's not too complicated to work around, but I thought I should share it.<br>
> Cheers<br>
><br>
> Fernando Benavides<br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
><br>
</blockquote></div><br>