[erlang-questions] import/1

Maria Christakis <>
Mon Jun 8 18:19:57 CEST 2009


I think import/1 is used like this:

"If a module from another package is used repeatedly in a module, an 
import declaration can make life easier:

    -module(foo.bar.m1).
    -export([f/1, g/1]).
    -import(fee.fie.foe.m2).

    f(X) -> m2:g(X).
    g(X) -> m2:h(X).

will make the calls to m2 refer to fee.fie.foe.m2."

Maria

Joel Reymont wrote:
>
> On Jun 8, 2009, at 4:57 PM, Robert Virding wrote:
>
>> Personally I only use it for importing functions from some very basic
>> modules like lists.
>
>
> I was trying to import all functions from a module to simplify a DSL.
>
> Alas, it seems like I either need to use prefixes or import all 
> functions individually.
>
> ---
> Mac hacker with a performance bent
> http://www.linkedin.com/in/joelreymont
>
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>



More information about the erlang-questions mailing list