“`{iex}
f = fn a -> case a do
%{_a, _b, _c} -> “A tuple of size 3, so what?”
_ -> “Uhh…. what’s that?”
end
end
“`
I get the following error: `** (CompileError) iex:24: expected key-value pairs in a map, got: _a`
Am I running a too old Elixir-Erland/OTP combo? Elixir v1.12..2 on Erlang 24 erts 12.2.1
I think the issue is you put a “%” on the front, making the datastructure a Map, but it’s and invalid structure for a map. Remove the “%” for it to be a tuple.
Excellent !!!
Awesome. I’m understanding more pattern matching.
Outstanding! 🎹 🎷 🎻 🎯
This is really helpful thanks.
When executing the following in `iex`:
“`{iex}
f = fn a -> case a do
%{_a, _b, _c} -> “A tuple of size 3, so what?”
_ -> “Uhh…. what’s that?”
end
end
“`
I get the following error: `** (CompileError) iex:24: expected key-value pairs in a map, got: _a`
Am I running a too old Elixir-Erland/OTP combo? Elixir v1.12..2 on Erlang 24 erts 12.2.1
I think the issue is you put a “%” on the front, making the datastructure a Map, but it’s and invalid structure for a map. Remove the “%” for it to be a tuple.
*insert-huge-facepalm-image-here*
You were right on target. Working like a charm now.
Thanks for the course and for your time.