Created
October 31, 2017 17:31
-
-
Save mariusbutuc/36d2ae806ad7f48571246625f23323f6 to your computer and use it in GitHub Desktop.
Elixir suggests using function headers when declaring default values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** (CompileError) lib/spreadsheet/functions.ex:340: definitions with multiple clauses and default values require a header. Instead of: | |
def foo(:first_clause, b \\ :default) do ... end | |
def foo(:second_clause, b) do ... end | |
one should write: | |
def foo(a, b \\ :default) | |
def foo(:first_clause, b) do ... end | |
def foo(:second_clause, b) do ... end | |
def nper/2 has multiple clauses and defines defaults in one or more clauses | |
lib/spreadsheet/functions.ex:340: (module) | |
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment