Skip to content

Instantly share code, notes, and snippets.

@mariusbutuc
Created October 31, 2017 17:31
Show Gist options
  • Save mariusbutuc/36d2ae806ad7f48571246625f23323f6 to your computer and use it in GitHub Desktop.
Save mariusbutuc/36d2ae806ad7f48571246625f23323f6 to your computer and use it in GitHub Desktop.
Elixir suggests using function headers when declaring default values.
** (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