<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi HowId,</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>There is a reason why the compiler can’t tell you that <i class="">erlang:spwan/1</i> is not defined.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Fully qualified function calls are <i class="">bound </i>(I’m not sure if that’s the right word) in runtime.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>That way you can have <a href="https://medium.com/erlang-battleground/the-laziest-erlang-git-user-ever-ff69d86cf3c1#.oofph855h" class="">ghost functions</a> or use <a href="http://eproxus.github.io/meck/" class="">meck</a> and many other goodies.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>That said, there are tools in OTP that would help you find those issues.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>To achieve precisely what you are asking for, you have <a href="http://erlang.org/doc/apps/tools/xref_chapter.html" class="">xref</a> (and if it seem to complex for you, don’t panic… you can always use <a href="https://hex.pm/packages/xref_runner" class="">xrefr</a>).</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>But if you want to catch many other kinds of errors (not just typos in function names) you <strike class="">can</strike> should use <a href="http://erlang.org/doc/apps/dialyzer/dialyzer_chapter.html" class="">dialyzer</a>.</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>And one last thing, if you want those check to happen automatically (which is something truly desirable), you can include the meta suite from <a href="https://hex.pm/packages/katana_test" class="">katana-test</a> in your common test suites.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Hope this helps :)</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 10, 2017, at 07:21, Howld <<a href="mailto:10z98@sina.cn" class="">10z98@sina.cn</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear Developers:<br class=""><div class="">     As a new developer, the result of the compile I hope is clear to indicate the functions in module if exist when I use compiler cmd like "erlc test.erl". But hopeless, if I write code like "elang:spwan(fun test:foo/0)" in erl file, it happens nothing even warning. I think it increases uncertainty<span class="p1-12"></span> with non-English speaking countrie's developers. And if you think so, I will shame on you. What I real want to express is you should have an idea and there is a long way to improve compiler.<br class=""><div class=""><br class="">Best blessing!<br class=""></div></div></div>_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""></body></html>