Erlang Notes-Erlang compilation error

Source: Internet
Author: User
Tags function definition
Module.beam:Module name ' Madule ' does not match file name ' module ' the module name your ' ve entered in The-module attribut E doesn ' t match the filename.
./module.erl:2: Warning:function some_function/0 is unused you have not exported a function, or the where where it ' s used has thewrong name or arity. It ' s also possible you ' ve written a function that isno longer needed. Check your code!
./module.erl:2: function some_function/1 undefined the function does not exist. You ' ve written the wrong name or arity either in The-export attributes or when declaring the function. This error is also output when the given function could isn't be compiled, usually because of a syntax error like forgetting To end a function with a period.
./module.erl:5: Syntax error before: ' Somecharacterorword ' This happens for a variety of reasons. Common causes are unclosed parentheses, tuples, or wrong expression (like termination the last closing of a case WI Th a comma). Other reasons include the "use of" a reserved atom in your code and Unicode characters not being con-verted correctly n Different encodings (I ' ve seen it happen!).
./module.erl:5: Syntax error before:this message was certainly not as descriptive as the previous one. It usually comes the up/your line termination be not correct. This is a specific case of the previous error, so just keep a eye out.
./module.erl:5: Warning:this expression'll fail with a ' badarith ' exception Erlang are all about dynamic typing, but REM Ember that the types are strong. In this case, the compiler are smart enough to find that one of your arithmetic expressions would fail (say, Llama + 5). It won ' t find type errors much more complex than that, though.
./module.erl:5: Warning:variable ' Var ' is unused to you declared a variable and never it. This might is a bug with your code and so double-check what for you have written. Otherwise, you might want to switch the variable name to _, or just prefix it with a underscore if you feel the name help s make the code readable.
./module.erl:5: Warning:a term is constructed, but never used at one of your functions, you ' re doing something as Bu Ilding a list, or declaring a tuple or a anonymous function without ever binding it to a variable or returning it. This warning tells for you ' re doing something useless or have made some.
./module.erl:5: Head mismatch It's possible your function has more than one head, and each of them has a different arity. Don ' t forget that different arity means different functions, and your can ' t interleave function declarations that way. Similarly, this error was raised when your insert a function definition between the head clauses of another function.
./MODULE.ERL:5: Warning:this clause cannot match because a previous clause at line 4 always matches a function defined in The module has a specific clause defined after a catchall one. As such, the compiler can warn you and I ll never even need to go to the other branch.
./module.erl:9: Variable ' a ' unsafe in ' case ' (line 5) you ' re using A variable declared within one of the branches of a CA Se ... of outside of it. This is considered unsafe. If you are want to use such variables, your ' re better off doing MyVar = case ... of.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.