Mon Jun 8 17:57:10 CEST 2009
When using import you have to explicitly state which functions you are
importing from a module. The compiler should complain here but I guess it is
interpreting it as
i.e. import no functions from foo.
Note that import does very little! All it does is to implicitly add the
module when calling an imported function. So after doing
a call to bar, for example bar(42), will be expanded to foo:bar(42). That is
all. It has no semantic meaning, or checks, or looking up the module, or
anything. It only saves some typing. This why you have to explicitly state
which functions to import.
Personally I only use it for importing functions from some very basic
modules like lists.
2009/6/8 Joel Reymont <>
> Is there a particular reason why -import(foo). does not work?
> The compiler does not complain but no functions seem to be imported.
> Thanks, Joel
> Mac hacker with a performance bent
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
More information about the erlang-questions