Skip to content

Instantly share code, notes, and snippets.

@kevsmith
Created September 16, 2015 18:47
Show Gist options
  • Save kevsmith/b182a55169f87ed4238b to your computer and use it in GitHub Desktop.
Save kevsmith/b182a55169f87ed4238b to your computer and use it in GitHub Desktop.
iex(1)> foo
** (RuntimeError) undefined function: foo/0
iex(1)> %{a: foo} = %{a: 1}
%{a: 1}
iex(2)> foo
1
iex(3)> %{a: foo} = %{a: 2}
%{a: 2}
iex(4)> foo
2
iex(5)> foo = 1
1
iex(6)> %{a: ^foo} = %{a: 2}
** (MatchError) no match of right hand side value: %{a: 2}
Eshell V6.4 (abort with ^G)
1> Foo.
* 1: variable 'Foo' is unbound
2> [{a, Foo}] = [{a, 1}].
[{a,1}]
3> Foo.
1
4> [{a, Foo}] = [{a, 2}].
** exception error: no match of right hand side value [{a,2}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment