Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Erlang how can I import all functions from a module?

Tags:

erlang

I can't figure out how to import all the functions of a module without having to specify the individual functions.

like image 236
yazz.com Avatar asked Mar 23 '10 21:03

yazz.com


People also ask

What does Module do in Erlang?

Erlang code is divided into modules. A module consists of a sequence of attributes and function declarations, each terminated by period (.). For a description of function declarations, see Function Declaration Syntax.

Does Erlang compile?

The Erlang compiler is written in Erlang and always available and can compile to either a file or a binary which can be immediately loaded into the system.


1 Answers

Reading from the Erlang Programming Rules:

Don't use -import, using it makes the code harder to read since you cannot directly see in what module a function is defined. Use exref (Cross Reference Tool) to find module dependencies.

like image 65
Roberto Aloi Avatar answered Oct 20 '22 19:10

Roberto Aloi