3
votes

Recently I found out about such thing as packages in Erlang language. The problem is I cannot compile module with package declaration. File main.erl with code represented below is located in directory /home/my_user/erl/update/src just like said in manual, but all my attempts to compile it failed. I use 18.0 version of erlang.

-module(update.src.main).
-author("legacy").

-export([start/0]).

start()->
  ok.

This is the result I got each time from erlang compiler:

5> c(main).
main.erl:9: syntax error before: '.'
main.erl:10: no module definition
error

Moreover, IntelliJ IDEA plugin for erlang language, which I use, reports an error in the string with module declaration and says that module update should be declared in file update.erl. I've tried to find something about problems with package usage, but all I've got was this question. So, haven't the packages in erlang been implemented yet or I missed something during compiling?

2

2 Answers

5
votes

http://www.erlang.org/news/35

The board decided to remove the unsupported 'packages' support from the product in R16.

For more details see also Why aren't erlang packages used?

1
votes

Old Manpage

Packages have been implemented but as yet they are only experimental, mainly because there is no consensus whether they should be in the language or not.

Almost erlang don't use package。Belong to otp ruler, you can use application to organize your code as package。

Erlang need that module name && file is the same name。 In erlang atom's name, it can't contain '.' . If you must use that, you can use 'a.c'.

Just Like that a.b.erl

-module('a.b').