Skip to content

Instantly share code, notes, and snippets.

@sevenseacat
Created August 5, 2015 06:53
Show Gist options
  • Save sevenseacat/f71feb7bbe6660fe98c6 to your computer and use it in GitHub Desktop.
Save sevenseacat/f71feb7bbe6660fe98c6 to your computer and use it in GitHub Desktop.
iex(1)> defmodule Something do
...(1)> def something(foo) when foo > 0, do: true
...(1)> end
{:module, Something,
<<70, 79, 82, 49, 0, 0, 4, 176, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 118, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 2, 104, 2, ...>>,
{:something, 1}}
iex(2)> Something.something(0)
** (FunctionClauseError) no function clause matching in Something.something/1
iex:2: Something.something(0)
iex(2)> Something.something(1)
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment