Why this pattern does not match

Hi, I am new to Erlang and have tried the code below in Match Matching. As expected, this will not work for me. Someone please help me better understand this concept.

1> Prat = {name,{{first,prat},{last,redy}},{age,23},occupation,{{company,"TS"},{work, "SW"}}}
2> {_,{_,_},_,_,{{_,c},_}} = Prat

But he returns me an unsurpassed error. Please help me with this.

+3
source share
1 answer

In this expression "{_,{_,_},_,_,{{_,c},_}} = Prat", c is a variable, must be uppercase. {_,{_,_},_,_,{{_,C},_}} = Prat.

C = "TS".

+8
source

All Articles