Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
showing how pinned values and pattern matching work in elixir
defmodule Robot do
def speak(name, phrase) do
fn
(^name) -> "hello! #{name}, #{phrase}"
(_) -> "sorry ... don't know this name"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.