Variable is unbound when used to pattern match as a key in a map
问题 I want to pattern match a map on a key when the second argument is a map with name 's value being the same as the key in the first argument's map. Instead I get this: 8> c(room). room.erl:23: variable 'PlayerName' is unbound error status({_Players, _Tables, ChallengerName}, #{name := ChallengerName}) -> #{status => challenging}; status({#{PlayerName := PlayerStatus}, _, _}, #{name := PlayerName}) -> PlayerStatus; status(_, _) -> #{status => null}. Oddly, the first function declaration works